summaryrefslogtreecommitdiff
path: root/sbin
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 /sbin
parentfb1fbb2bee40770f12e27ddf78fdbc55f5d3f4b9 (diff)
EAGAIN handling for imsg_read. OK henning@ benno@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c4
-rw-r--r--sbin/iked/control.c5
-rw-r--r--sbin/iked/proc.c4
3 files changed, 7 insertions, 6 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 9e728550cc7..890586b4823 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.366 2015/11/12 18:46:14 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.367 2015/12/05 13:09:11 claudio Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2014,7 +2014,7 @@ fork_privchld(int fd, int fd2)
if (nfds == 0 || !(pfd[0].revents & POLLIN))
continue;
- if ((n = imsg_read(priv_ibuf)) == -1) {
+ if ((n = imsg_read(priv_ibuf)) == -1 && errno != EAGAIN) {
warning("imsg_read(priv_ibuf): %s", strerror(errno));
quit = INTERNALSIG;
continue;
diff --git a/sbin/iked/control.c b/sbin/iked/control.c
index e08a2b9a666..32ef9e60397 100644
--- a/sbin/iked/control.c
+++ b/sbin/iked/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.20 2015/11/23 19:28:33 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.21 2015/12/05 13:09:46 claudio Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -263,7 +263,8 @@ control_dispatch_imsg(int fd, short event, void *arg)
}
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, cs);
return;
}
diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c
index c6948d9a129..32e823e81f6 100644
--- a/sbin/iked/proc.c
+++ b/sbin/iked/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.26 2015/11/23 19:28:34 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.27 2015/12/05 13:09:46 claudio Exp $ */
/*
* Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -456,7 +456,7 @@ proc_dispatch(int fd, short event, void *arg)
ibuf = &iev->ibuf;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal(__func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */