diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2015-12-05 13:15:28 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2015-12-05 13:15:28 +0000 |
commit | 6f2aa8b0e980a251b178417803edb1088b014897 (patch) | |
tree | 94417c743b25f8e364487235ab5c76915e5bf499 /sbin/iked | |
parent | fb1fbb2bee40770f12e27ddf78fdbc55f5d3f4b9 (diff) |
EAGAIN handling for imsg_read. OK henning@ benno@
Diffstat (limited to 'sbin/iked')
-rw-r--r-- | sbin/iked/control.c | 5 | ||||
-rw-r--r-- | sbin/iked/proc.c | 4 |
2 files changed, 5 insertions, 4 deletions
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 */ |