Sync msgbuf_write() changes from relayd.
authorreyk <reyk@openbsd.org>
Sat, 12 Jul 2014 14:15:04 +0000 (14:15 +0000)
committerreyk <reyk@openbsd.org>
Sat, 12 Jul 2014 14:15:04 +0000 (14:15 +0000)
Please note that proc.c should be kept identical in relayd, iked and
snmpd (currently without the includes).

ok benno@

sbin/iked/proc.c
usr.sbin/snmpd/control.c
usr.sbin/snmpd/proc.c

index 37a9d14..5fc1b6f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: proc.c,v 1.17 2014/05/08 13:11:16 blambert Exp $      */
+/*     $OpenBSD: proc.c,v 1.18 2014/07/12 14:15:04 reyk Exp $  */
 
 /*
  * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -464,7 +464,7 @@ proc_dispatch(int fd, short event, void *arg)
        }
 
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal(title);
        }
 
index 8e613a2..686ca47 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: control.c,v 1.25 2014/06/03 06:25:47 yasuoka Exp $    */
+/*     $OpenBSD: control.c,v 1.26 2014/07/12 14:15:04 reyk Exp $       */
 
 /*
  * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -238,7 +238,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
                }
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&c->iev.ibuf.w) < 0 && errno != EAGAIN) {
+               if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) {
                        control_close(c);
                        return;
                }
index c10dcd0..5f692fc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: proc.c,v 1.9 2014/05/08 13:04:28 blambert Exp $       */
+/*     $OpenBSD: proc.c,v 1.10 2014/07/12 14:15:04 reyk Exp $  */
 
 /*
  * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -464,7 +464,7 @@ proc_dispatch(int fd, short event, void *arg)
        }
 
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal(title);
        }