summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/control.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2014-07-11 16:43:33 +0000
committerkrw <krw@openbsd.org>2014-07-11 16:43:33 +0000
commit9a23296289b2bcf3d31d8be94e90e75b7357fe84 (patch)
tree3f82aaf21faea35483ca1bcce4dd0b342e921f1f /usr.sbin/ospfd/control.c
parentnet.inet6.ip6.accept_rtadv bit the bucket (diff)
downloadwireguard-openbsd-9a23296289b2bcf3d31d8be94e90e75b7357fe84.tar.xz
wireguard-openbsd-9a23296289b2bcf3d31d8be94e90e75b7357fe84.zip
Close the control fd when it has reported EOF.
ok henning@
Diffstat (limited to 'usr.sbin/ospfd/control.c')
-rw-r--r--usr.sbin/ospfd/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c
index 27344950c24..1cade9b7969 100644
--- a/usr.sbin/ospfd/control.c
+++ b/usr.sbin/ospfd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.39 2013/11/13 20:43:00 benno Exp $ */
+/* $OpenBSD: control.c,v 1.40 2014/07/11 16:43:33 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -230,7 +230,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
}
if (event & EV_WRITE) {
- if (msgbuf_write(&c->iev.ibuf.w) == -1 && errno != EAGAIN) {
+ if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) {
control_close(fd);
return;
}