-/* $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.
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)
-/* $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>
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;
}