summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:06:32 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:06:32 +0000
commit5eeda5072225febdb498941a3e2bdcda5694cb64 (patch)
tree28218498e931fe4aa019c05ea26f65af3ce84925
parentae6903b9e32081b24fc1068760ef4df0be489658 (diff)
imsg_flush no longer returns EAGAIN. Simplify proc_flush_imsg() accordingly.
Issue spotted by op@
-rw-r--r--sbin/iked/proc.c7
-rw-r--r--usr.sbin/httpd/proc.c7
-rw-r--r--usr.sbin/relayd/proc.c7
-rw-r--r--usr.sbin/snmpd/proc.c7
-rw-r--r--usr.sbin/vmd/proc.c7
5 files changed, 10 insertions, 25 deletions
diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c
index 337063f76e8..29c74825fca 100644
--- a/sbin/iked/proc.c
+++ b/sbin/iked/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.44 2024/04/09 15:48:01 tobhe Exp $ */
+/* $OpenBSD: proc.c,v 1.45 2024/11/21 13:06:19 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -860,10 +860,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_procid id, int n)
for (; n < m; n++) {
if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
return (-1);
- do {
- ret = imsg_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
+ if ((ret = imsg_flush(ibuf)) == -1)
break;
imsg_event_add(&ps->ps_ievs[id][n]);
}
diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c
index 6b0461eaf1e..73dabf2670b 100644
--- a/usr.sbin/httpd/proc.c
+++ b/usr.sbin/httpd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.45 2024/04/09 15:48:01 tobhe Exp $ */
+/* $OpenBSD: proc.c,v 1.46 2024/11/21 13:06:25 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -817,10 +817,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_procid id, int n)
for (; n < m; n++) {
if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
return (-1);
- do {
- ret = imsg_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
+ if ((ret = imsg_flush(ibuf)) == -1)
break;
imsg_event_add(&ps->ps_ievs[id][n]);
}
diff --git a/usr.sbin/relayd/proc.c b/usr.sbin/relayd/proc.c
index 1da7e585fc4..233ea86b191 100644
--- a/usr.sbin/relayd/proc.c
+++ b/usr.sbin/relayd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.45 2024/01/17 10:01:24 claudio Exp $ */
+/* $OpenBSD: proc.c,v 1.46 2024/11/21 13:06:27 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -818,10 +818,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_procid id, int n)
for (; n < m; n++) {
if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
return (-1);
- do {
- ret = imsg_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
+ if ((ret = imsg_flush(ibuf)) == -1)
break;
imsg_event_add(&ps->ps_ievs[id][n]);
}
diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c
index 8d5cb109c50..e60404b0aac 100644
--- a/usr.sbin/snmpd/proc.c
+++ b/usr.sbin/snmpd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.32 2024/04/09 15:48:01 tobhe Exp $ */
+/* $OpenBSD: proc.c,v 1.33 2024/11/21 13:06:29 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -785,10 +785,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_procid id, int n)
for (; n < m; n++) {
if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
return (-1);
- do {
- ret = imsg_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
+ if ((ret = imsg_flush(ibuf)) == -1)
break;
imsg_event_add(&ps->ps_ievs[id][n]);
}
diff --git a/usr.sbin/vmd/proc.c b/usr.sbin/vmd/proc.c
index ef14fa3e1bb..9c963ef1730 100644
--- a/usr.sbin/vmd/proc.c
+++ b/usr.sbin/vmd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.26 2024/09/26 01:45:13 jsg Exp $ */
+/* $OpenBSD: proc.c,v 1.27 2024/11/21 13:06:31 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -825,10 +825,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_procid id, int n)
for (; n < m; n++) {
if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
return (-1);
- do {
- ret = imsg_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
+ if ((ret = imsg_flush(ibuf)) == -1)
break;
imsg_event_add(&ps->ps_ievs[id][n]);
}