summaryrefslogtreecommitdiff
path: root/usr.sbin/dvmrpd/control.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-05-31 17:13:05 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-05-31 17:13:05 +0000
commit27c775ee9dc631b95ec2a1f83dad749c8ee5d8bb (patch)
tree43bb57e81aa795866deb3e40e83a91b0a570a3a3 /usr.sbin/dvmrpd/control.c
parente7efeba3453124e29efa6e347ad74898bd0b4ccd (diff)
More libevent callback fixes. While there make n also ssize_t as in all
other daemons.
Diffstat (limited to 'usr.sbin/dvmrpd/control.c')
-rw-r--r--usr.sbin/dvmrpd/control.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/dvmrpd/control.c b/usr.sbin/dvmrpd/control.c
index f078914ec6c..5ed8a7ea6fc 100644
--- a/usr.sbin/dvmrpd/control.c
+++ b/usr.sbin/dvmrpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.5 2009/02/25 17:09:55 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.6 2009/05/31 17:13:04 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -198,22 +198,18 @@ control_dispatch_imsg(int fd, short event, void *bula)
return;
}
- switch (event) {
- case EV_READ:
+ if (event & EV_READ) {
if ((n = imsg_read(&c->ibuf)) == -1 || n == 0) {
control_close(fd);
return;
}
- break;
- case EV_WRITE:
- if (msgbuf_write(&c->ibuf.w) < 0) {
+ }
+ if (event & EV_WRITE) {
+ if (msgbuf_write(&c->ibuf.w) == -1) {
control_close(fd);
return;
}
imsg_event_add(&c->ibuf);
- return;
- default:
- fatalx("unknown event");
}
for (;;) {