summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-03 14:06:43 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-03 14:06:43 +0000
commit31ec8d6d746e8bf365990ee271f1a77c3c1e3d0a (patch)
tree1d1e1cbd5efba904cccaf29f881f96efafddbf88
parent9a036d216a1cf77b21b0610eeff34251279dbafa (diff)
cope with changed imsg_read semantics
-rw-r--r--usr.sbin/bgpctl/bgpctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 5232ba6cdaf..ff8adff1902 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.2 2004/01/03 13:55:18 henning Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.3 2004/01/03 14:06:42 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -66,9 +66,12 @@ main(int argc, char *argv[])
done = 0;
while (!done) {
- if(imsg_read(&ibuf) == -1)
+ if((n = imsg_read(&ibuf)) == -1)
break;
+ if (n == 0)
+ errx(1, "pipe closed");
+
while (!done) {
if ((n = imsg_get(&ibuf, &imsg)) == -1)
errx(1, "imsg_get error");