summaryrefslogtreecommitdiffstats
path: root/lib/libevent
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2003-10-01 09:10:30 +0000
committermarkus <markus@openbsd.org>2003-10-01 09:10:30 +0000
commit5b97e645a645ffa2d11f78aadff56af48cae48f9 (patch)
tree3c12399067e3b045e6e63bb5769cc82bb4c959a0 /lib/libevent
parentoops, didn't change the Makefile. (diff)
downloadwireguard-openbsd-5b97e645a645ffa2d11f78aadff56af48cae48f9.tar.xz
wireguard-openbsd-5b97e645a645ffa2d11f78aadff56af48cae48f9.zip
poll fixes from Niels; ok deraadt
Diffstat (limited to 'lib/libevent')
-rw-r--r--lib/libevent/poll.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libevent/poll.c b/lib/libevent/poll.c
index 727c4dfa25a..acb3911375f 100644
--- a/lib/libevent/poll.c
+++ b/lib/libevent/poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll.c,v 1.1 2003/09/23 08:52:04 markus Exp $ */
+/* $OpenBSD: poll.c,v 1.2 2003/10/01 09:10:30 markus Exp $ */
/*
* Copyright 2000-2003 Niels Provos <provos@citi.umich.edu>
@@ -193,10 +193,13 @@ poll_dispatch(void *arg, struct timeval *tv)
for (i = 0; i < nfds; i++) {
res = 0;
+ /* If the file gets closed notify */
+ if (pop->event_set[i].revents & POLLHUP)
+ pop->event_set[i].revents = POLLIN|POLLOUT;
if (pop->event_set[i].revents & POLLIN)
- res = EV_READ;
- else if (pop->event_set[i].revents & POLLOUT)
- res = EV_WRITE;
+ res |= EV_READ;
+ if (pop->event_set[i].revents & POLLOUT)
+ res |= EV_WRITE;
if (res == 0)
continue;