summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-24 13:28:03 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-24 13:28:03 +0000
commitb9f919ad8e4bd53a01b04a664c619a8833fe4eea (patch)
treebaf977705fd3ead7ef8d3c29bd377d9e0dd5dad4 /usr.sbin/bgpd/rde.c
parentf924fc5687fcce16de3cbe026d2266242ff50a73 (diff)
handle write() returning 0 correctly, adjust the msgbuf API appropriately,
and make all callers cope.
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index e7f8352b879..16af16b34e0 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.23 2003/12/23 19:14:49 deraadt Exp $ */
+/* $OpenBSD: rde.c,v 1.24 2003/12/24 13:28:02 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -148,15 +148,14 @@ rde_main(struct bgpd_config *config, int pipe_m2r[2], int pipe_s2r[2])
if (nfds > 0 && (pfd[PFD_PIPE_MAIN].revents & POLLOUT) &&
ibuf_main.w.queued) {
nfds--;
- if ((n = msgbuf_write(&ibuf_main.w)) == -1)
+ if ((n = msgbuf_write(&ibuf_main.w)) < 0)
fatal("pipe write error", errno);
}
if (nfds > 0 && (pfd[PFD_PIPE_SESSION].revents & POLLOUT) &&
ibuf_se.w.queued) {
nfds--;
- if ((n = msgbuf_write(&ibuf_se.w)) ==
- -1)
+ if ((n = msgbuf_write(&ibuf_se.w)) < 0)
fatal("pipe write error", errno);
}
}