diff options
71 files changed, 176 insertions, 191 deletions
diff --git a/sbin/dhcp6leased/control.c b/sbin/dhcp6leased/control.c index 14c46002cd0..df3da1035c3 100644 --- a/sbin/dhcp6leased/control.c +++ b/sbin/dhcp6leased/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.7 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.8 2024/11/21 13:21:33 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -231,8 +231,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/sbin/dhcp6leased/dhcp6leased.c b/sbin/dhcp6leased/dhcp6leased.c index 7930d0cf290..50ce64edf23 100644 --- a/sbin/dhcp6leased/dhcp6leased.c +++ b/sbin/dhcp6leased/dhcp6leased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp6leased.c,v 1.17 2024/11/21 13:18:37 claudio Exp $ */ +/* $OpenBSD: dhcp6leased.c,v 1.18 2024/11/21 13:21:33 claudio Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org> @@ -426,7 +426,7 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/dhcp6leased/engine.c b/sbin/dhcp6leased/engine.c index df3454dba0e..0f1ab78f58e 100644 --- a/sbin/dhcp6leased/engine.c +++ b/sbin/dhcp6leased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.28 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.29 2024/11/21 13:21:33 claudio Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org> @@ -276,7 +276,7 @@ engine_dispatch_frontend(int fd, short event, void *bula) uint32_t if_index; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -385,7 +385,7 @@ engine_dispatch_main(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/dhcp6leased/frontend.c b/sbin/dhcp6leased/frontend.c index 79ea9d4095a..24b3e2afe1d 100644 --- a/sbin/dhcp6leased/frontend.c +++ b/sbin/dhcp6leased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.18 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.19 2024/11/21 13:21:33 claudio Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org> @@ -243,7 +243,7 @@ frontend_dispatch_main(int fd, short event, void *bula) int shut = 0, udpsock, if_index; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -449,7 +449,7 @@ frontend_dispatch_engine(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/dhcpleased/control.c b/sbin/dhcpleased/control.c index 57d3750ae93..b342c62d09a 100644 --- a/sbin/dhcpleased/control.c +++ b/sbin/dhcpleased/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.10 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.11 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -233,8 +233,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c index e3438df2f10..907dbccf5bc 100644 --- a/sbin/dhcpleased/dhcpleased.c +++ b/sbin/dhcpleased/dhcpleased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpleased.c,v 1.37 2024/11/21 13:18:37 claudio Exp $ */ +/* $OpenBSD: dhcpleased.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org> @@ -444,7 +444,7 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -526,7 +526,7 @@ main_dispatch_engine(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index e3a684a076d..8cd975af9d0 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.53 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org> @@ -289,7 +289,7 @@ engine_dispatch_frontend(int fd, short event, void *bula) uint32_t if_index, type; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -406,7 +406,7 @@ engine_dispatch_main(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/dhcpleased/frontend.c b/sbin/dhcpleased/frontend.c index c5e22590dd7..9fb18677d75 100644 --- a/sbin/dhcpleased/frontend.c +++ b/sbin/dhcpleased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.43 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.44 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org> @@ -242,7 +242,7 @@ frontend_dispatch_main(int fd, short event, void *bula) int shut = 0, bpfsock, if_index, udpsock; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -485,7 +485,7 @@ frontend_dispatch_engine(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/iked/control.c b/sbin/iked/control.c index 84142055a9d..71c46b20954 100644 --- a/sbin/iked/control.c +++ b/sbin/iked/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.43 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.44 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -261,8 +261,7 @@ control_dispatch_imsg(int fd, short event, void *arg) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd, cs); return; } diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c index aa3a81afe55..6b914dff0a5 100644 --- a/sbin/iked/proc.c +++ b/sbin/iked/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.49 2024/11/21 13:18:37 claudio Exp $ */ +/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -617,7 +617,7 @@ proc_dispatch(int fd, short event, void *arg) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("%s: imsgbuf_read", __func__); if (n == 0) { /* this pipe is dead, so remove the event handler */ diff --git a/sbin/slaacd/control.c b/sbin/slaacd/control.c index 113af0a8e68..948f3083327 100644 --- a/sbin/slaacd/control.c +++ b/sbin/slaacd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.15 2024/11/21 13:17:56 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.16 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -234,8 +234,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c index 52e92f7279a..f825bfb41ee 100644 --- a/sbin/slaacd/engine.c +++ b/sbin/slaacd/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.97 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.98 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -465,7 +465,7 @@ engine_dispatch_frontend(int fd, short event, void *bula) uint32_t if_index, type; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -633,7 +633,7 @@ engine_dispatch_main(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c index 2b0bcc18d6e..d0e9fa5d618 100644 --- a/sbin/slaacd/frontend.c +++ b/sbin/slaacd/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.72 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.73 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -286,7 +286,7 @@ frontend_dispatch_main(int fd, short event, void *bula) int shut = 0, icmp6sock, rdomain; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -398,7 +398,7 @@ frontend_dispatch_engine(int fd, short event, void *bula) uint32_t if_index, type; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c index 6e1577331da..1c231af0848 100644 --- a/sbin/slaacd/slaacd.c +++ b/sbin/slaacd/slaacd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacd.c,v 1.77 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: slaacd.c,v 1.78 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -391,7 +391,7 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -472,7 +472,7 @@ main_dispatch_engine(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/unwind/control.c b/sbin/unwind/control.c index 0b84aa5a99c..0b79362e9ac 100644 --- a/sbin/unwind/control.c +++ b/sbin/unwind/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.21 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.22 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -233,8 +233,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/sbin/unwind/frontend.c b/sbin/unwind/frontend.c index 452c8762787..1312540af37 100644 --- a/sbin/unwind/frontend.c +++ b/sbin/unwind/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.87 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.88 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -311,7 +311,7 @@ frontend_dispatch_main(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -492,7 +492,7 @@ frontend_dispatch_resolver(int fd, short event, void *bula) int n, shut = 0, chg; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index c807921551e..8010761f82a 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.171 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: resolver.c,v 1.172 2024/11/21 13:21:34 claudio Exp $ */ /* @@ -495,7 +495,7 @@ resolver_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -633,7 +633,7 @@ resolver_dispatch_main(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/sbin/unwind/unwind.c b/sbin/unwind/unwind.c index ad871fc48da..830b410ac58 100644 --- a/sbin/unwind/unwind.c +++ b/sbin/unwind/unwind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unwind.c,v 1.73 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: unwind.c,v 1.74 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -398,7 +398,7 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -463,7 +463,7 @@ main_dispatch_resolver(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/usr.bin/tmux/proc.c b/usr.bin/tmux/proc.c index f9a522db51b..de6d61329bb 100644 --- a/usr.bin/tmux/proc.c +++ b/usr.bin/tmux/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.28 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: proc.c,v 1.29 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -77,8 +77,7 @@ proc_event_cb(__unused int fd, short events, void *arg) struct imsg imsg; if (!(peer->flags & PEER_BAD) && (events & EV_READ)) { - if (((n = imsgbuf_read(&peer->ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&peer->ibuf) != 1) { peer->dispatchcb(NULL, peer->arg); return; } diff --git a/usr.sbin/dhcp6leasectl/dhcp6leasectl.c b/usr.sbin/dhcp6leasectl/dhcp6leasectl.c index 5926be2923e..b29eb42b1af 100644 --- a/usr.sbin/dhcp6leasectl/dhcp6leasectl.c +++ b/usr.sbin/dhcp6leasectl/dhcp6leasectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp6leasectl.c,v 1.3 2024/11/21 13:17:01 claudio Exp $ */ +/* $OpenBSD: dhcp6leasectl.c,v 1.4 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2021, 2024 Florian Obser <florian@openbsd.org> @@ -139,7 +139,7 @@ main(int argc, char *argv[]) if (imsgbuf_flush(ibuf) == -1) err(1, "write error"); - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/dhcpleasectl/dhcpleasectl.c b/usr.sbin/dhcpleasectl/dhcpleasectl.c index 91a766d89d2..389769dd99c 100644 --- a/usr.sbin/dhcpleasectl/dhcpleasectl.c +++ b/usr.sbin/dhcpleasectl/dhcpleasectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpleasectl.c,v 1.10 2024/11/21 13:17:01 claudio Exp $ */ +/* $OpenBSD: dhcpleasectl.c,v 1.11 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2021 Florian Obser <florian@openbsd.org> @@ -173,7 +173,7 @@ main(int argc, char *argv[]) if (imsgbuf_flush(ibuf) == -1) err(1, "write error"); - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/dvmrpctl/dvmrpctl.c b/usr.sbin/dvmrpctl/dvmrpctl.c index f7fa58e3bf1..a31f5ead2bc 100644 --- a/usr.sbin/dvmrpctl/dvmrpctl.c +++ b/usr.sbin/dvmrpctl/dvmrpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpctl.c,v 1.18 2024/11/21 13:17:01 claudio Exp $ */ +/* $OpenBSD: dvmrpctl.c,v 1.19 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -177,7 +177,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/dvmrpd/control.c b/usr.sbin/dvmrpd/control.c index 9169a067be2..3287410740b 100644 --- a/usr.sbin/dvmrpd/control.c +++ b/usr.sbin/dvmrpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.29 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -228,8 +228,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/dvmrpd/dvmrpd.c b/usr.sbin/dvmrpd/dvmrpd.c index d2aa6e85cef..518b2aca682 100644 --- a/usr.sbin/dvmrpd/dvmrpd.c +++ b/usr.sbin/dvmrpd/dvmrpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpd.c,v 1.32 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: dvmrpd.c,v 1.33 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -317,7 +317,7 @@ main_dispatch_dvmrpe(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -381,7 +381,7 @@ main_dispatch_rde(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/dvmrpd/dvmrpe.c b/usr.sbin/dvmrpd/dvmrpe.c index c80d89eb7eb..48573ba86a9 100644 --- a/usr.sbin/dvmrpd/dvmrpe.c +++ b/usr.sbin/dvmrpd/dvmrpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpe.c,v 1.28 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: dvmrpe.c,v 1.29 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -241,7 +241,7 @@ dvmrpe_dispatch_main(int fd, short event, void *bula) int shut = 0, link_ok; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -257,7 +257,7 @@ dvmrpe_dispatch_main(int fd, short event, void *bula) for (;;) { if ((n = imsg_get(ibuf, &imsg)) == -1) - fatal("dvmrpe_dispatch_main: imsgbuf_read error"); + fatal("dvmrpe_dispatch_main: imsg_get error"); if (n == 0) break; @@ -317,7 +317,7 @@ dvmrpe_dispatch_rde(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -333,7 +333,7 @@ dvmrpe_dispatch_rde(int fd, short event, void *bula) for (;;) { if ((n = imsg_get(ibuf, &imsg)) == -1) - fatal("dvmrpe_dispatch_rde: imsgbuf_read error"); + fatal("dvmrpe_dispatch_rde: imsgbuf_get error"); if (n == 0) break; diff --git a/usr.sbin/dvmrpd/rde.c b/usr.sbin/dvmrpd/rde.c index 3c7c7e3fb86..0eafee6028a 100644 --- a/usr.sbin/dvmrpd/rde.c +++ b/usr.sbin/dvmrpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.37 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -206,7 +206,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) struct iface *iface; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/eigrpctl/eigrpctl.c b/usr.sbin/eigrpctl/eigrpctl.c index 99201698ec0..b0779eba043 100644 --- a/usr.sbin/eigrpctl/eigrpctl.c +++ b/usr.sbin/eigrpctl/eigrpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpctl.c,v 1.11 2024/11/21 13:17:01 claudio Exp $ */ +/* $OpenBSD: eigrpctl.c,v 1.12 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -221,7 +221,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/eigrpd/control.c b/usr.sbin/eigrpd/control.c index 0a2609c5f58..ad56b64c155 100644 --- a/usr.sbin/eigrpd/control.c +++ b/usr.sbin/eigrpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.14 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.15 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -220,8 +220,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/eigrpd/eigrpd.c b/usr.sbin/eigrpd/eigrpd.c index 876ceb74876..03b2b99ca50 100644 --- a/usr.sbin/eigrpd/eigrpd.c +++ b/usr.sbin/eigrpd/eigrpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpd.c,v 1.34 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: eigrpd.c,v 1.35 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -373,7 +373,7 @@ main_dispatch_eigrpe(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -451,7 +451,7 @@ main_dispatch_rde(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c index 5075e5a2a53..f4232109018 100644 --- a/usr.sbin/eigrpd/eigrpe.c +++ b/usr.sbin/eigrpd/eigrpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpe.c,v 1.45 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: eigrpe.c,v 1.46 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -226,7 +226,7 @@ eigrpe_dispatch_main(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -398,7 +398,7 @@ eigrpe_dispatch_rde(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/eigrpd/rde.c b/usr.sbin/eigrpd/rde.c index ec6afc01243..5bcfd383c05 100644 --- a/usr.sbin/eigrpd/rde.c +++ b/usr.sbin/eigrpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.30 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.31 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -175,7 +175,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -312,7 +312,7 @@ rde_dispatch_parent(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/httpd/control.c b/usr.sbin/httpd/control.c index 55976ae5618..f5d8143a24b 100644 --- a/usr.sbin/httpd/control.c +++ b/usr.sbin/httpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.19 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.20 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -229,8 +229,7 @@ control_dispatch_imsg(int fd, short event, void *arg) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd, cs); return; } diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c index ca7fb6ff8f4..972946f82a4 100644 --- a/usr.sbin/httpd/proc.c +++ b/usr.sbin/httpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: proc.c,v 1.51 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -601,7 +601,7 @@ proc_dispatch(int fd, short event, void *arg) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("%s: imsgbuf_read", __func__); if (n == 0) { /* this pipe is dead, so remove the event handler */ diff --git a/usr.sbin/ikectl/ikectl.c b/usr.sbin/ikectl/ikectl.c index 99fa755ff35..93f061c0460 100644 --- a/usr.sbin/ikectl/ikectl.c +++ b/usr.sbin/ikectl/ikectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikectl.c,v 1.33 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ikectl.c,v 1.34 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2007-2013 Reyk Floeter <reyk@openbsd.org> @@ -343,7 +343,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ldapctl/ldapctl.c b/usr.sbin/ldapctl/ldapctl.c index a18db60a939..0178a0be336 100644 --- a/usr.sbin/ldapctl/ldapctl.c +++ b/usr.sbin/ldapctl/ldapctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldapctl.c,v 1.18 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ldapctl.c,v 1.19 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se> @@ -359,7 +359,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(&ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(&ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c index 48974cc583a..1b9571e863c 100644 --- a/usr.sbin/ldpctl/ldpctl.c +++ b/usr.sbin/ldpctl/ldpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpctl.c,v 1.34 2024/11/21 13:17:02 claudio Exp $ +/* $OpenBSD: ldpctl.c,v 1.35 2024/11/21 13:21:34 claudio Exp $ * * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -210,7 +210,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c index 7fcbaaf94cb..aaad9d2576f 100644 --- a/usr.sbin/ldpd/control.c +++ b/usr.sbin/ldpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.36 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -203,8 +203,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c index a7c43fa0fc1..de7b65e43a7 100644 --- a/usr.sbin/ldpd/lde.c +++ b/usr.sbin/ldpd/lde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lde.c,v 1.82 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: lde.c,v 1.83 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -198,7 +198,7 @@ lde_dispatch_imsg(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -395,7 +395,7 @@ lde_dispatch_parent(int fd, short event, void *bula) struct fec fec; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c index 8b26b02e1e2..088cf991f74 100644 --- a/usr.sbin/ldpd/ldpd.c +++ b/usr.sbin/ldpd/ldpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpd.c,v 1.75 2024/11/21 13:20:00 claudio Exp $ */ +/* $OpenBSD: ldpd.c,v 1.76 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -379,7 +379,7 @@ main_dispatch_ldpe(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -460,7 +460,7 @@ main_dispatch_lde(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c index 8c6d0721316..cf5bc0710f4 100644 --- a/usr.sbin/ldpd/ldpe.c +++ b/usr.sbin/ldpd/ldpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.c,v 1.86 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: ldpe.c,v 1.87 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -231,7 +231,7 @@ ldpe_dispatch_main(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -497,7 +497,7 @@ ldpe_dispatch_lde(int fd, short event, void *bula) struct nbr *nbr = NULL; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospf6ctl/ospf6ctl.c b/usr.sbin/ospf6ctl/ospf6ctl.c index ea7cd609f1c..965edcc86af 100644 --- a/usr.sbin/ospf6ctl/ospf6ctl.c +++ b/usr.sbin/ospf6ctl/ospf6ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6ctl.c,v 1.56 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ospf6ctl.c,v 1.57 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -254,7 +254,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ospf6d/control.c b/usr.sbin/ospf6d/control.c index 9c192549f83..f762f890154 100644 --- a/usr.sbin/ospf6d/control.c +++ b/usr.sbin/ospf6d/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.36 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -252,8 +252,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c index 6805d6ee39f..1b5c7a83424 100644 --- a/usr.sbin/ospf6d/ospf6d.c +++ b/usr.sbin/ospf6d/ospf6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6d.c,v 1.59 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: ospf6d.c,v 1.60 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -340,7 +340,7 @@ main_dispatch_ospfe(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -418,7 +418,7 @@ main_dispatch_rde(int fd, short event, void *bula) int count, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c index 30b4b45d111..d9ec27c8f72 100644 --- a/usr.sbin/ospf6d/ospfe.c +++ b/usr.sbin/ospf6d/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.76 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.77 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -258,7 +258,7 @@ ospfe_dispatch_main(int fd, short event, void *bula) int n, stub_changed, shut = 0, isvalid, wasvalid; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -451,7 +451,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) u_int16_t l, age; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c index 1e45a2aa491..4118c579944 100644 --- a/usr.sbin/ospf6d/rde.c +++ b/usr.sbin/ospf6d/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.95 2024/11/21 13:17:57 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.96 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -276,7 +276,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) u_int16_t l; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -652,7 +652,7 @@ rde_dispatch_parent(int fd, short event, void *bula) int shut = 0, link_ok, prev_link_ok, orig_lsa; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c index d30683de03e..f5ffd5134d0 100644 --- a/usr.sbin/ospfctl/ospfctl.c +++ b/usr.sbin/ospfctl/ospfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfctl.c,v 1.70 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ospfctl.c,v 1.71 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -221,7 +221,7 @@ main(int argc, char *argv[]) output->head(res); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c index 48bac139bb9..482af7f017c 100644 --- a/usr.sbin/ospfd/control.c +++ b/usr.sbin/ospfd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.52 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.53 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -252,8 +252,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index 1975d2a0257..0afbbb5f15c 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.c,v 1.122 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: ospfd.c,v 1.123 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -358,7 +358,7 @@ main_dispatch_ospfe(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -446,7 +446,7 @@ main_dispatch_rde(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index 554e4a83f14..3796d153669 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.118 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.119 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -272,7 +272,7 @@ ospfe_dispatch_main(int fd, short event, void *bula) int n, link_ok, stub_changed, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -496,7 +496,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) u_int16_t l, age; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index b8e3254e5bb..b4dd8648ca9 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.116 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.117 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -266,7 +266,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -651,7 +651,7 @@ rde_dispatch_parent(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ractl/ractl.c b/usr.sbin/ractl/ractl.c index 588f265958f..003bc55f245 100644 --- a/usr.sbin/ractl/ractl.c +++ b/usr.sbin/ractl/ractl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ractl.c,v 1.5 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ractl.c,v 1.6 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -127,7 +127,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/rad/control.c b/usr.sbin/rad/control.c index e491dbcb407..43f1a49af73 100644 --- a/usr.sbin/rad/control.c +++ b/usr.sbin/rad/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.12 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.13 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -230,8 +230,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c index b5fbe02226b..f3b6c7756e4 100644 --- a/usr.sbin/rad/engine.c +++ b/usr.sbin/rad/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.26 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.27 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -194,7 +194,7 @@ engine_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -278,7 +278,7 @@ engine_dispatch_main(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c index 9e177a5cb67..fc4cf5f919b 100644 --- a/usr.sbin/rad/frontend.c +++ b/usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.53 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -319,7 +319,7 @@ frontend_dispatch_main(int fd, short event, void *bula) int n, shut = 0, icmp6sock, rdomain; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -534,7 +534,7 @@ frontend_dispatch_engine(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c index 36ccfa1c24c..11c7d154585 100644 --- a/usr.sbin/rad/rad.c +++ b/usr.sbin/rad/rad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.c,v 1.36 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: rad.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -381,7 +381,7 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; @@ -451,7 +451,7 @@ main_dispatch_engine(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c index e751407e7ec..ed0fa92b97d 100644 --- a/usr.sbin/relayctl/relayctl.c +++ b/usr.sbin/relayctl/relayctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayctl.c,v 1.60 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: relayctl.c,v 1.61 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2007 - 2013 Reyk Floeter <reyk@openbsd.org> @@ -225,7 +225,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c index 864ee775fd5..e54259c5971 100644 --- a/usr.sbin/relayd/ca.c +++ b/usr.sbin/relayd/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.44 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ca.c,v 1.45 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -357,7 +357,7 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa, default: break; } - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatalx("imsgbuf_read"); if (n == 0) fatalx("pipe closed"); diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index d88cf0b00a2..828b83e8cdf 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.62 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.63 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -231,8 +231,7 @@ control_dispatch_imsg(int fd, short event, void *arg) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd, cs); return; } diff --git a/usr.sbin/relayd/proc.c b/usr.sbin/relayd/proc.c index 85a00980a31..253a907ccc1 100644 --- a/usr.sbin/relayd/proc.c +++ b/usr.sbin/relayd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: proc.c,v 1.51 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -602,7 +602,7 @@ proc_dispatch(int fd, short event, void *arg) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("%s: imsgbuf_read", __func__); if (n == 0) { /* this pipe is dead, so remove the event handler */ diff --git a/usr.sbin/ripctl/ripctl.c b/usr.sbin/ripctl/ripctl.c index 085bea62326..faaf8634903 100644 --- a/usr.sbin/ripctl/ripctl.c +++ b/usr.sbin/ripctl/ripctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripctl.c,v 1.19 2024/11/21 13:17:02 claudio Exp $ +/* $OpenBSD: ripctl.c,v 1.20 2024/11/21 13:21:34 claudio Exp $ * * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -191,7 +191,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ripd/control.c b/usr.sbin/ripd/control.c index ec4524a01e2..f651e4887a1 100644 --- a/usr.sbin/ripd/control.c +++ b/usr.sbin/ripd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.32 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.33 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -219,8 +219,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && - errno != EAGAIN) || n == 0) { + if (imsgbuf_read(&c->iev.ibuf) != 1) { control_close(fd); return; } diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c index a2b0fd9c065..f4eee623520 100644 --- a/usr.sbin/ripd/rde.c +++ b/usr.sbin/ripd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.29 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -197,7 +197,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -300,7 +300,7 @@ rde_dispatch_parent(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c index e6a653afbe3..a8a900e6556 100644 --- a/usr.sbin/ripd/ripd.c +++ b/usr.sbin/ripd/ripd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripd.c,v 1.42 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: ripd.c,v 1.43 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -314,7 +314,7 @@ main_dispatch_ripe(int fd, short event, void *bula) int shut = 0, verbose; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -394,7 +394,7 @@ main_dispatch_rde(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c index decd44904a3..0b702fc6dc9 100644 --- a/usr.sbin/ripd/ripe.c +++ b/usr.sbin/ripd/ripe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripe.c,v 1.35 2024/11/21 13:17:58 claudio Exp $ */ +/* $OpenBSD: ripe.c,v 1.36 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -231,7 +231,7 @@ ripe_dispatch_main(int fd, short event, void *bula) int link_ok, shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; @@ -312,7 +312,7 @@ ripe_dispatch_rde(int fd, short event, void *bula) int shut = 0; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) /* connection closed */ shut = 1; diff --git a/usr.sbin/slaacctl/slaacctl.c b/usr.sbin/slaacctl/slaacctl.c index a0f72fcc429..f70b79aefde 100644 --- a/usr.sbin/slaacctl/slaacctl.c +++ b/usr.sbin/slaacctl/slaacctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacctl.c,v 1.25 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: slaacctl.c,v 1.26 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -140,7 +140,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index fc33a48bb29..4455cdd1f5b 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.37 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: proc.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -577,7 +577,7 @@ proc_dispatch(int fd, short event, void *arg) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("%s: imsgbuf_read", __func__); if (n == 0) { /* this pipe is dead, so remove the event handler */ diff --git a/usr.sbin/unwindctl/unwindctl.c b/usr.sbin/unwindctl/unwindctl.c index 8200552a2bc..8e528049c17 100644 --- a/usr.sbin/unwindctl/unwindctl.c +++ b/usr.sbin/unwindctl/unwindctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unwindctl.c,v 1.31 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: unwindctl.c,v 1.32 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -181,7 +181,7 @@ main(int argc, char *argv[]) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c index 6b22ea3b9e6..3e51738368d 100644 --- a/usr.sbin/vmctl/main.c +++ b/usr.sbin/vmctl/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.81 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: main.c,v 1.82 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -277,7 +277,7 @@ vmmaction(struct parse_result *res) err(1, "write error"); while (!done) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) errx(1, "imsgbuf_read error"); if (n == 0) errx(1, "pipe closed"); diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c index b48b6198b06..5d94b7fd755 100644 --- a/usr.sbin/ypldap/ldapclient.c +++ b/usr.sbin/ypldap/ldapclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldapclient.c,v 1.53 2024/11/21 13:17:02 claudio Exp $ */ +/* $OpenBSD: ldapclient.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org> @@ -141,7 +141,7 @@ client_dispatch_dns(int fd, short events, void *p) fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) shut = 1; @@ -241,7 +241,7 @@ client_dispatch_parent(int fd, short events, void *p) fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) shut = 1; diff --git a/usr.sbin/ypldap/ypldap.c b/usr.sbin/ypldap/ypldap.c index 159e5ceb658..c15498e0f1c 100644 --- a/usr.sbin/ypldap/ypldap.c +++ b/usr.sbin/ypldap/ypldap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypldap.c,v 1.29 2024/11/21 13:18:38 claudio Exp $ */ +/* $OpenBSD: ypldap.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -361,7 +361,7 @@ main_dispatch_client(int fd, short events, void *p) fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) shut = 1; diff --git a/usr.sbin/ypldap/ypldap_dns.c b/usr.sbin/ypldap/ypldap_dns.c index 1ab6f0bb5ef..0129b7c3a77 100644 --- a/usr.sbin/ypldap/ypldap_dns.c +++ b/usr.sbin/ypldap/ypldap_dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypldap_dns.c,v 1.19 2024/11/21 13:17:03 claudio Exp $ */ +/* $OpenBSD: ypldap_dns.c,v 1.20 2024/11/21 13:21:34 claudio Exp $ */ /* * Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org> @@ -146,7 +146,7 @@ dns_dispatch_imsg(int fd, short events, void *p) fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + if ((n = imsgbuf_read(ibuf)) == -1) fatal("imsgbuf_read error"); if (n == 0) shut = 1; |