summaryrefslogtreecommitdiff
path: root/usr.sbin/ripd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2015-12-05 13:15:28 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2015-12-05 13:15:28 +0000
commit6f2aa8b0e980a251b178417803edb1088b014897 (patch)
tree94417c743b25f8e364487235ab5c76915e5bf499 /usr.sbin/ripd
parentfb1fbb2bee40770f12e27ddf78fdbc55f5d3f4b9 (diff)
EAGAIN handling for imsg_read. OK henning@ benno@
Diffstat (limited to 'usr.sbin/ripd')
-rw-r--r--usr.sbin/ripd/control.c5
-rw-r--r--usr.sbin/ripd/rde.c10
-rw-r--r--usr.sbin/ripd/ripd.c6
-rw-r--r--usr.sbin/ripd/ripe.c10
4 files changed, 16 insertions, 15 deletions
diff --git a/usr.sbin/ripd/control.c b/usr.sbin/ripd/control.c
index 38165c497c5..c39aa1b2228 100644
--- a/usr.sbin/ripd/control.c
+++ b/usr.sbin/ripd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.21 2015/02/09 12:13:42 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.22 2015/12/05 13:13:47 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -220,7 +220,8 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
- if ((n = imsg_read(&c->iev.ibuf)) == -1 || n == 0) {
+ if (((n = imsg_read(&c->iev.ibuf)) == -1 && errno != EAGAIN) ||
+ n == 0) {
control_close(fd);
return;
}
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c
index 79f033b1f88..e2fed2672d2 100644
--- a/usr.sbin/ripd/rde.c
+++ b/usr.sbin/ripd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.18 2015/01/16 06:40:20 deraadt Exp $ */
+/* $OpenBSD: rde.c,v 1.19 2015/12/05 13:13:47 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -193,7 +193,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
@@ -207,7 +207,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
- fatal("rde_dispatch_imsg: imsg_read error");
+ fatal("rde_dispatch_imsg: imsg_get error");
if (n == 0)
break;
@@ -295,7 +295,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
@@ -309,7 +309,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
- fatal("rde_dispatch_parent: imsg_read error");
+ fatal("rde_dispatch_parent: imsg_get error");
if (n == 0)
break;
diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c
index efaeba35db0..a3d69366359 100644
--- a/usr.sbin/ripd/ripd.c
+++ b/usr.sbin/ripd/ripd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.c,v 1.25 2015/02/09 12:13:42 claudio Exp $ */
+/* $OpenBSD: ripd.c,v 1.26 2015/12/05 13:13:47 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -342,7 +342,7 @@ main_dispatch_ripe(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
@@ -421,7 +421,7 @@ main_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c
index 86d1d5382e4..48d6aae1f26 100644
--- a/usr.sbin/ripd/ripe.c
+++ b/usr.sbin/ripd/ripe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripe.c,v 1.18 2015/02/09 12:34:07 claudio Exp $ */
+/* $OpenBSD: ripe.c,v 1.19 2015/12/05 13:13:47 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -234,7 +234,7 @@ ripe_dispatch_main(int fd, short event, void *bula)
int link_ok, shut = 0;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
@@ -248,7 +248,7 @@ ripe_dispatch_main(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
- fatal("ripe_dispatch_main: imsg_read error");
+ fatal("ripe_dispatch_main: imsg_get error");
if (n == 0)
break;
@@ -314,7 +314,7 @@ ripe_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0) /* connection closed */
shut = 1;
@@ -328,7 +328,7 @@ ripe_dispatch_rde(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
- fatal("ripe_dispatch_rde: imsg_read error");
+ fatal("ripe_dispatch_rde: imsg_get error");
if (n == 0)
break;