summaryrefslogtreecommitdiff
path: root/usr.sbin/rad/engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rad/engine.c')
-rw-r--r--usr.sbin/rad/engine.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c
index f3b6c7756e4..cc18b5537bb 100644
--- a/usr.sbin/rad/engine.c
+++ b/usr.sbin/rad/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.27 2024/11/21 13:21:34 claudio Exp $ */
+/* $OpenBSD: engine.c,v 1.28 2024/11/21 13:38:15 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -134,7 +134,9 @@ engine(int debug, int verbose)
if ((iev_main = malloc(sizeof(struct imsgev))) == NULL)
fatal(NULL);
- imsgbuf_init(&iev_main->ibuf, 3);
+ if (imsgbuf_init(&iev_main->ibuf, 3) == -1)
+ fatal(NULL);
+ imsgbuf_allow_fdpass(&iev_main->ibuf);
iev_main->handler = engine_dispatch_main;
/* Setup event handlers. */
@@ -316,7 +318,8 @@ engine_dispatch_main(int fd, short event, void *bula)
if (iev_frontend == NULL)
fatal(NULL);
- imsgbuf_init(&iev_frontend->ibuf, fd);
+ if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
+ fatal(NULL);
iev_frontend->handler = engine_dispatch_frontend;
iev_frontend->events = EV_READ;