From 8ba96280f053fdd089dbc85f9852dfae96a5ac11 Mon Sep 17 00:00:00 2001 From: krw Date: Sat, 12 Jul 2014 19:22:32 +0000 Subject: [PATCH] msgbuf_write() <= 0 for a few more daemons. ok claudio@ --- usr.sbin/dvmrpd/dvmrpd.c | 6 +++--- usr.sbin/dvmrpd/dvmrpe.c | 6 +++--- usr.sbin/dvmrpd/rde.c | 4 ++-- usr.sbin/ldpd/packet.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/dvmrpd/dvmrpd.c b/usr.sbin/dvmrpd/dvmrpd.c index d1ddf5a7b77..cca3415a6c5 100644 --- a/usr.sbin/dvmrpd/dvmrpd.c +++ b/usr.sbin/dvmrpd/dvmrpd.c @@ -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 @@ -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"); } diff --git a/usr.sbin/dvmrpd/dvmrpe.c b/usr.sbin/dvmrpd/dvmrpe.c index fd45b7a2cc7..79c656cc593 100644 --- a/usr.sbin/dvmrpd/dvmrpe.c +++ b/usr.sbin/dvmrpd/dvmrpe.c @@ -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 @@ -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"); } diff --git a/usr.sbin/dvmrpd/rde.c b/usr.sbin/dvmrpd/rde.c index 5fe56d6e81e..8add327c20b 100644 --- a/usr.sbin/dvmrpd/rde.c +++ b/usr.sbin/dvmrpd/rde.c @@ -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 @@ -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"); } diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c index 4b4bc8bc9f5..541df5438bd 100644 --- a/usr.sbin/ldpd/packet.c +++ b/usr.sbin/ldpd/packet.c @@ -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 @@ -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); } -- 2.20.1