summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-03-19 10:12:00 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-03-19 10:12:00 +0000
commit4d7b413950b93c44f0a9722f962708b91fbd723e (patch)
treef4289fbde5a81cf7f1e5ccb68dfe35dbfa6a46bf /usr.sbin
parent163943975a360a0fbc4d140d18ec9c783be371c0 (diff)
do not signal "connection closed" upstream on EINTR/EAGAIN, from bgpd et al
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/hoststated/control.c4
-rw-r--r--usr.sbin/hoststated/imsg.c4
-rw-r--r--usr.sbin/relayd/control.c4
-rw-r--r--usr.sbin/relayd/imsg.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/hoststated/control.c b/usr.sbin/hoststated/control.c
index bfd318f45ea..f758ee4a6b8 100644
--- a/usr.sbin/hoststated/control.c
+++ b/usr.sbin/hoststated/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.13 2007/02/08 13:32:24 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.14 2007/03/19 10:11:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -191,7 +191,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
switch (event) {
case EV_READ:
- if ((n = imsg_read(&c->ibuf)) <= 0) {
+ if ((n = imsg_read(&c->ibuf)) == -1 || n == 0) {
control_close(fd);
return;
}
diff --git a/usr.sbin/hoststated/imsg.c b/usr.sbin/hoststated/imsg.c
index 83d633e2dc1..4b21fbe0934 100644
--- a/usr.sbin/hoststated/imsg.c
+++ b/usr.sbin/hoststated/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.5 2007/01/29 14:23:31 pyr Exp $ */
+/* $OpenBSD: imsg.c,v 1.6 2007/03/19 10:11:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -55,7 +55,7 @@ imsg_read(struct imsgbuf *ibuf)
log_warn("imsg_read: pipe read error");
return (-1);
}
- return (0);
+ return (-2);
}
ibuf->r.wpos += n;
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c
index bfd318f45ea..f758ee4a6b8 100644
--- a/usr.sbin/relayd/control.c
+++ b/usr.sbin/relayd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.13 2007/02/08 13:32:24 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.14 2007/03/19 10:11:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -191,7 +191,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
switch (event) {
case EV_READ:
- if ((n = imsg_read(&c->ibuf)) <= 0) {
+ if ((n = imsg_read(&c->ibuf)) == -1 || n == 0) {
control_close(fd);
return;
}
diff --git a/usr.sbin/relayd/imsg.c b/usr.sbin/relayd/imsg.c
index 83d633e2dc1..4b21fbe0934 100644
--- a/usr.sbin/relayd/imsg.c
+++ b/usr.sbin/relayd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.5 2007/01/29 14:23:31 pyr Exp $ */
+/* $OpenBSD: imsg.c,v 1.6 2007/03/19 10:11:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -55,7 +55,7 @@ imsg_read(struct imsgbuf *ibuf)
log_warn("imsg_read: pipe read error");
return (-1);
}
- return (0);
+ return (-2);
}
ibuf->r.wpos += n;