summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/imsg.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/imsg.c
parentf924fc5687fcce16de3cbe026d2266242ff50a73 (diff)
handle write() returning 0 correctly, adjust the msgbuf API appropriately,
and make all callers cope.
Diffstat (limited to 'usr.sbin/bgpd/imsg.c')
-rw-r--r--usr.sbin/bgpd/imsg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c
index 0424062d18c..fbaa7c1a55e 100644
--- a/usr.sbin/bgpd/imsg.c
+++ b/usr.sbin/bgpd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.8 2003/12/21 23:28:39 henning Exp $ */
+/* $OpenBSD: imsg.c,v 1.9 2003/12/24 13:28:02 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -111,8 +111,8 @@ imsg_compose(struct imsgbuf *ibuf, int type, u_int32_t peerid, void *data,
if (datalen)
if (buf_add(wbuf, data, datalen) == -1)
fatal("imsg_compose: buf_add error", 0);
- if ((n = buf_close(&ibuf->w, wbuf)) == -1)
- fatal("imsg_compose: buf_close error", 0);
+ if ((n = buf_close(&ibuf->w, wbuf)) < 0)
+ fatal("imsg_compose: buf_close error", errno);
return (n);
}