summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:21:35 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:21:35 +0000
commit1a0eb6e692853cb677467310a038e5fe280f3699 (patch)
tree51f8c73da0757429b74c6ef9238bcd6a78bea856 /usr.sbin
parente75872a2cea9594c5b07a18dd0e22720199b0aeb (diff)
Convert the common imsgbuf_read calls to the post EAGAIN world.
OK tb@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcp6leasectl/dhcp6leasectl.c4
-rw-r--r--usr.sbin/dhcpleasectl/dhcpleasectl.c4
-rw-r--r--usr.sbin/dvmrpctl/dvmrpctl.c4
-rw-r--r--usr.sbin/dvmrpd/control.c5
-rw-r--r--usr.sbin/dvmrpd/dvmrpd.c6
-rw-r--r--usr.sbin/dvmrpd/dvmrpe.c10
-rw-r--r--usr.sbin/dvmrpd/rde.c4
-rw-r--r--usr.sbin/eigrpctl/eigrpctl.c4
-rw-r--r--usr.sbin/eigrpd/control.c5
-rw-r--r--usr.sbin/eigrpd/eigrpd.c6
-rw-r--r--usr.sbin/eigrpd/eigrpe.c6
-rw-r--r--usr.sbin/eigrpd/rde.c6
-rw-r--r--usr.sbin/httpd/control.c5
-rw-r--r--usr.sbin/httpd/proc.c4
-rw-r--r--usr.sbin/ikectl/ikectl.c4
-rw-r--r--usr.sbin/ldapctl/ldapctl.c4
-rw-r--r--usr.sbin/ldpctl/ldpctl.c4
-rw-r--r--usr.sbin/ldpd/control.c5
-rw-r--r--usr.sbin/ldpd/lde.c6
-rw-r--r--usr.sbin/ldpd/ldpd.c6
-rw-r--r--usr.sbin/ldpd/ldpe.c6
-rw-r--r--usr.sbin/ospf6ctl/ospf6ctl.c4
-rw-r--r--usr.sbin/ospf6d/control.c5
-rw-r--r--usr.sbin/ospf6d/ospf6d.c6
-rw-r--r--usr.sbin/ospf6d/ospfe.c6
-rw-r--r--usr.sbin/ospf6d/rde.c6
-rw-r--r--usr.sbin/ospfctl/ospfctl.c4
-rw-r--r--usr.sbin/ospfd/control.c5
-rw-r--r--usr.sbin/ospfd/ospfd.c6
-rw-r--r--usr.sbin/ospfd/ospfe.c6
-rw-r--r--usr.sbin/ospfd/rde.c6
-rw-r--r--usr.sbin/ractl/ractl.c4
-rw-r--r--usr.sbin/rad/control.c5
-rw-r--r--usr.sbin/rad/engine.c6
-rw-r--r--usr.sbin/rad/frontend.c6
-rw-r--r--usr.sbin/rad/rad.c6
-rw-r--r--usr.sbin/relayctl/relayctl.c4
-rw-r--r--usr.sbin/relayd/ca.c4
-rw-r--r--usr.sbin/relayd/control.c5
-rw-r--r--usr.sbin/relayd/proc.c4
-rw-r--r--usr.sbin/ripctl/ripctl.c4
-rw-r--r--usr.sbin/ripd/control.c5
-rw-r--r--usr.sbin/ripd/rde.c6
-rw-r--r--usr.sbin/ripd/ripd.c6
-rw-r--r--usr.sbin/ripd/ripe.c6
-rw-r--r--usr.sbin/slaacctl/slaacctl.c4
-rw-r--r--usr.sbin/snmpd/proc.c4
-rw-r--r--usr.sbin/unwindctl/unwindctl.c4
-rw-r--r--usr.sbin/vmctl/main.c4
-rw-r--r--usr.sbin/ypldap/ldapclient.c6
-rw-r--r--usr.sbin/ypldap/ypldap.c4
-rw-r--r--usr.sbin/ypldap/ypldap_dns.c4
52 files changed, 127 insertions, 136 deletions
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;