diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:38:16 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:38:16 +0000 |
commit | d54f1ade2567f1c6dc26b339312d1336d564a152 (patch) | |
tree | 74538403c70e3e601a2afbb807050093ec09275e /usr.sbin/ldpd/lde.c | |
parent | 33a588df978f85e7cafd5cb8ad0c0488cf1d643e (diff) |
Convert simple stuff in usr.sbin over to new imsgbuf_init behaviour
OK tb@
Diffstat (limited to 'usr.sbin/ldpd/lde.c')
-rw-r--r-- | usr.sbin/ldpd/lde.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c index de7b65e43a7..0cd4a74559a 100644 --- a/usr.sbin/ldpd/lde.c +++ b/usr.sbin/ldpd/lde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lde.c,v 1.83 2024/11/21 13:21:34 claudio Exp $ */ +/* $OpenBSD: lde.c,v 1.84 2024/11/21 13:38:14 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -128,7 +128,9 @@ lde(int debug, int verbose) /* setup pipe and event handler to the parent process */ 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 = lde_dispatch_parent; iev_main->events = EV_READ; event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events, @@ -464,7 +466,8 @@ lde_dispatch_parent(int fd, short event, void *bula) if ((iev_ldpe = malloc(sizeof(struct imsgev))) == NULL) fatal(NULL); - imsgbuf_init(&iev_ldpe->ibuf, fd); + if (imsgbuf_init(&iev_ldpe->ibuf, fd) == -1) + fatal(NULL); iev_ldpe->handler = lde_dispatch_imsg; iev_ldpe->events = EV_READ; event_set(&iev_ldpe->ev, iev_ldpe->ibuf.fd, |