Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libevent deal correctly with POLLNHUP



details:   https://anonhg.NetBSD.org/src/rev/dec32016f528
branches:  trunk
changeset: 552629:dec32016f528
user:      provos <provos%NetBSD.org@localhost>
date:      Sun Sep 28 20:02:44 2003 +0000

description:
deal correctly with POLLNHUP

diffstat:

 lib/libevent/poll.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 0c438e628508 -r dec32016f528 lib/libevent/poll.c
--- a/lib/libevent/poll.c       Sun Sep 28 18:32:18 2003 +0000
+++ b/lib/libevent/poll.c       Sun Sep 28 20:02:44 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: poll.c,v 1.3 2003/06/13 04:11:31 itojun Exp $  */
+/*     $NetBSD: poll.c,v 1.4 2003/09/28 20:02:44 provos Exp $  */
 /*     $OpenBSD: poll.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
 
 /*
@@ -194,10 +194,13 @@
 
        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;
 



Home | Main Index | Thread Index | Old Index