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 /usr.sbin/snmpd | |
parent | fb1fbb2bee40770f12e27ddf78fdbc55f5d3f4b9 (diff) |
EAGAIN handling for imsg_read. OK henning@ benno@
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r-- | usr.sbin/snmpd/control.c | 5 | ||||
-rw-r--r-- | usr.sbin/snmpd/proc.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/snmpd/control.c b/usr.sbin/snmpd/control.c index 79ad97e0f38..af9f44e56a2 100644 --- a/usr.sbin/snmpd/control.c +++ b/usr.sbin/snmpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.36 2015/12/05 06:42:18 mmcc Exp $ */ +/* $OpenBSD: control.c,v 1.37 2015/12/05 13:14:40 claudio Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -236,7 +236,8 @@ control_dispatch_imsg(int fd, short event, void *arg) int n, v, i; if (event & EV_READ) { - if ((n = imsg_read_nofd(&c->iev.ibuf)) == -1 || n == 0) { + if (((n = imsg_read_nofd(&c->iev.ibuf)) == -1 && + errno != EAGAIN) || n == 0) { control_close(c, "could not read imsg", NULL); return; } diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index 80c94a9d2f2..9b135411889 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.17 2015/11/23 19:31:52 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.18 2015/12/05 13:14:40 claudio Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -452,7 +452,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 */ |