From b9f919ad8e4bd53a01b04a664c619a8833fe4eea Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 24 Dec 2003 13:28:03 +0000 Subject: handle write() returning 0 correctly, adjust the msgbuf API appropriately, and make all callers cope. --- usr.sbin/bgpd/rde.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr.sbin/bgpd/rde.c') 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 @@ -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); } } -- cgit v1.2.3