diff options
author | 2014-07-22 02:02:59 +0000 | |
---|---|---|
committer | 2014-07-22 02:02:59 +0000 | |
commit | 5d71a92083c3c77ca0df3caf1eceee5c023dcfad (patch) | |
tree | 4302c0b88a11c996f61932f14a4f8e29840f5446 | |
parent | change the test for still-open Unix domain sockets to be robust against (diff) | |
download | wireguard-openbsd-5d71a92083c3c77ca0df3caf1eceee5c023dcfad.tar.xz wireguard-openbsd-5d71a92083c3c77ca0df3caf1eceee5c023dcfad.zip |
Handle msgbuf_write() returning EAGAIN.
from krw
-rw-r--r-- | usr.sbin/npppctl/npppctl.c | 4 | ||||
-rw-r--r-- | usr.sbin/npppd/npppd/control.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/npppctl/npppctl.c b/usr.sbin/npppctl/npppctl.c index 27d0489b641..6f75d825c19 100644 --- a/usr.sbin/npppctl/npppctl.c +++ b/usr.sbin/npppctl/npppctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npppctl.c,v 1.3 2014/04/03 07:10:18 yasuoka Exp $ */ +/* $OpenBSD: npppctl.c,v 1.4 2014/07/22 02:02:59 yasuoka Exp $ */ /* * Copyright (c) 2012 Internet Initiative Japan Inc. @@ -511,7 +511,7 @@ imsg_wait_command_completion(void) int n; while (ctl_ibuf.w.queued) - if (msgbuf_write(&ctl_ibuf.w) < -1) + if (msgbuf_write(&ctl_ibuf.w) <= 0 && errno != EAGAIN) return (-1); do { if ((n = imsg_get(&ctl_ibuf, &ctl_imsg)) == -1) diff --git a/usr.sbin/npppd/npppd/control.c b/usr.sbin/npppd/npppd/control.c index 19746c4bd68..d7ce1b525d9 100644 --- a/usr.sbin/npppd/npppd/control.c +++ b/usr.sbin/npppd/npppd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.1 2014/03/22 04:30:31 yasuoka Exp $ */ +/* $OpenBSD: control.c,v 1.2 2014/07/22 02:03:00 yasuoka Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -252,7 +252,7 @@ control_dispatch_imsg(int fd, short event, void *arg) if (event & EV_WRITE) { - if (msgbuf_write(&c->iev.ibuf.w) < 0) { + if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) { control_close(fd, cs); return; } |