msgbuf_write() <= 0 for a few more daemons.
authorkrw <krw@openbsd.org>
Sat, 12 Jul 2014 19:22:32 +0000 (19:22 +0000)
committerkrw <krw@openbsd.org>
Sat, 12 Jul 2014 19:22:32 +0000 (19:22 +0000)
ok claudio@

usr.sbin/dvmrpd/dvmrpd.c
usr.sbin/dvmrpd/dvmrpe.c
usr.sbin/dvmrpd/rde.c
usr.sbin/ldpd/packet.c

index d1ddf5a..cca3415 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dvmrpd.c,v 1.15 2013/11/26 11:32:30 henning Exp $ */
+/*     $OpenBSD: dvmrpd.c,v 1.16 2014/07/12 19:22:32 krw Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -366,7 +366,7 @@ main_dispatch_dvmrpe(int fd, short event, void *bula)
                        fatalx("pipe closed");
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal("msgbuf_write");
        }
 
@@ -419,7 +419,7 @@ main_dispatch_rde(int fd, short event, void *bula)
                        fatalx("pipe closed");
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal("msgbuf_write");
        }
 
index fd45b7a..79c656c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dvmrpe.c,v 1.11 2013/11/26 11:32:31 henning Exp $ */
+/*     $OpenBSD: dvmrpe.c,v 1.12 2014/07/12 19:22:32 krw Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -249,7 +249,7 @@ dvmrpe_dispatch_main(int fd, short event, void *bula)
                        fatalx("pipe closed");
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal("msgbuf_write");
        }
 
@@ -314,7 +314,7 @@ dvmrpe_dispatch_rde(int fd, short event, void *bula)
                        fatalx("pipe closed");
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal("msgbuf_write");
        }
 
index 5fe56d6..8add327 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde.c,v 1.23 2013/11/26 11:32:31 henning Exp $ */
+/*     $OpenBSD: rde.c,v 1.24 2014/07/12 19:22:32 krw Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -209,7 +209,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
                        fatalx("pipe closed");
        }
        if (event & EV_WRITE) {
-               if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+               if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
                        fatal("msgbuf_write");
        }
 
index 4b4bc8b..541df54 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: packet.c,v 1.34 2013/11/26 11:59:38 henning Exp $ */
+/*     $OpenBSD: packet.c,v 1.35 2014/07/12 19:22:32 krw Exp $ */
 
 /*
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -507,7 +507,7 @@ session_write(int fd, short event, void *arg)
        struct nbr *nbr = tcp->nbr;
 
        if (event & EV_WRITE) {
-               if (msgbuf_write(&tcp->wbuf.wbuf) == -1 && errno != EAGAIN) {
+               if (msgbuf_write(&tcp->wbuf.wbuf) <= 0 && errno != EAGAIN) {
                        if (nbr)
                                nbr_fsm(nbr, NBR_EVT_CLOSE_SESSION);
                }