summaryrefslogtreecommitdiff
path: root/sbin/slaacd
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 /sbin/slaacd
parente75872a2cea9594c5b07a18dd0e22720199b0aeb (diff)
Convert the common imsgbuf_read calls to the post EAGAIN world.
OK tb@
Diffstat (limited to 'sbin/slaacd')
-rw-r--r--sbin/slaacd/control.c5
-rw-r--r--sbin/slaacd/engine.c6
-rw-r--r--sbin/slaacd/frontend.c6
-rw-r--r--sbin/slaacd/slaacd.c6
4 files changed, 11 insertions, 12 deletions
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;