diff options
Diffstat (limited to 'usr.sbin/ospf6d/ospf6d.c')
-rw-r--r-- | usr.sbin/ospf6d/ospf6d.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/usr.sbin/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c index 7b874ad2b1c..870035d00b2 100644 --- a/usr.sbin/ospf6d/ospf6d.c +++ b/usr.sbin/ospf6d/ospf6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6d.c,v 1.12 2009/03/28 15:38:58 michele Exp $ */ +/* $OpenBSD: ospf6d.c,v 1.13 2009/05/31 17:00:40 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -352,20 +352,16 @@ main_dispatch_ospfe(int fd, short event, void *bula) ssize_t n; int shut = 0; - switch (event) { - case EV_READ: + if (event & EV_READ) { if ((n = imsg_read(ibuf)) == -1) fatal("imsg_read error"); if (n == 0) /* connection closed */ shut = 1; - 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 (;;) { @@ -423,20 +419,16 @@ main_dispatch_rde(int fd, short event, void *bula) ssize_t n; int shut = 0; - switch (event) { - case EV_READ: + if (event & EV_READ) { if ((n = imsg_read(ibuf)) == -1) fatal("imsg_read error"); if (n == 0) /* connection closed */ shut = 1; - 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 (;;) { |