summaryrefslogtreecommitdiff
path: root/usr.sbin/dvmrpd/rde.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/rde.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/rde.c')
-rw-r--r--usr.sbin/dvmrpd/rde.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.sbin/dvmrpd/rde.c b/usr.sbin/dvmrpd/rde.c
index fdeb3b9d7ca..abf07d7e363 100644
--- a/usr.sbin/dvmrpd/rde.c
+++ b/usr.sbin/dvmrpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.16 2009/05/20 16:10:04 michele Exp $ */
+/* $OpenBSD: rde.c,v 1.17 2009/05/31 17:13:04 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -194,23 +194,20 @@ rde_dispatch_imsg(int fd, short event, void *bula)
struct imsg imsg;
struct route_report rr;
struct nbr_msg nm;
- int i, n, connected = 0;
+ int i, connected = 0;
+ ssize_t n;
struct iface *iface;
- switch (event) {
- case EV_READ:
+ if (event & EV_READ) {
if ((n = imsg_read(ibuf)) == -1)
fatal("imsg_read error");
if (n == 0) /* connection closed */
fatalx("pipe closed");
- break;
- case EV_WRITE:
+ }
+ if (event & EV_WRITE) {
if (msgbuf_write(&ibuf->w) == -1)
fatal("msgbuf_write");
imsg_event_add(ibuf);
- return;
- default:
- fatalx("unknown event");
}
for (;;) {