summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2013-11-13 20:43:01 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2013-11-13 20:43:01 +0000
commitfb9e9cba60b5f6df07638c05a083213470d08fb2 (patch)
tree6be4c9e9a422b17f68c7dbe9020032eaa3c2b385 /usr.sbin
parent8fcf78b288ccd7b30e9d03613e3ada5f9fcf5183 (diff)
from claudio
"Let msgbuf_write return -1 with errno EAGAIN. The users then must check if this was the case and readd the event or poll again. The current handling in the imsg code is wrong for sure." ok gilles, benno
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/control.c4
-rw-r--r--usr.sbin/ospfd/ospfd.c6
-rw-r--r--usr.sbin/ospfd/ospfe.c6
-rw-r--r--usr.sbin/ospfd/rde.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c
index 35d9c1f3359..27344950c24 100644
--- a/usr.sbin/ospfd/control.c
+++ b/usr.sbin/ospfd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.38 2013/03/11 17:40:11 deraadt Exp $ */
+/* $OpenBSD: control.c,v 1.39 2013/11/13 20:43:00 benno 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) {
+ if (msgbuf_write(&c->iev.ibuf.w) == -1 && errno != EAGAIN) {
control_close(fd);
return;
}
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 8e1e30d7bac..5a18ea2b58e 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.79 2013/03/22 11:29:01 sthen Exp $ */
+/* $OpenBSD: ospfd.c,v 1.80 2013/11/13 20:43:00 benno Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -384,7 +384,7 @@ main_dispatch_ospfe(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}
@@ -469,7 +469,7 @@ main_dispatch_rde(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index d0dfd8aaf88..e7749c93794 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.86 2013/03/22 08:42:55 sthen Exp $ */
+/* $OpenBSD: ospfe.c,v 1.87 2013/11/13 20:43:00 benno Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -279,7 +279,7 @@ ospfe_dispatch_main(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}
@@ -439,7 +439,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c
index 0155e1cd813..2441639b5b5 100644
--- a/usr.sbin/ospfd/rde.c
+++ b/usr.sbin/ospfd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.94 2011/05/09 12:24:41 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.95 2013/11/13 20:43:00 benno Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -261,7 +261,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}
@@ -624,7 +624,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if (msgbuf_write(&ibuf->w) == -1)
+ if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
}