summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/control.c')
-rw-r--r--usr.sbin/bgpd/control.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index ff2571928dc..b889e491834 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.12 2004/01/06 23:14:58 henning Exp $ */
+/* $OpenBSD: control.c,v 1.13 2004/01/09 13:14:25 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -180,6 +180,15 @@ control_dispatch_msg(struct pollfd *pfd, int i)
return (0);
}
+ if (pfd->revents & POLLOUT)
+ if (msgbuf_write(&c->ibuf.w) < 0) {
+ control_close(pfd->fd);
+ return (1);
+ }
+
+ if (!(pfd->revents & POLLIN))
+ return (0);
+
if (imsg_read(&c->ibuf) <= 0) {
control_close(pfd->fd);
return (1);