Enable multiple fd events on a single file descriptor
authorVolker Lendecke <vl@samba.org>
Tue, 1 Apr 2008 13:29:59 +0000 (15:29 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Apr 2008 11:13:47 +0000 (13:13 +0200)
Now we can have multiple events listen on a single fd. The order in which they
are called is naturally not defined, meaning that it is only deterministic if
exactly one event is readable or writeable.
(This used to be commit 61503f822b60f98dd1f7549707ec89b48e32caeb)

source3/lib/events.c

index f7bad9bcad11550fe89e7a171078f4fbe4737ba3..9decf213b4a71017fd58744649a8efbd70333b21 100644 (file)
@@ -292,7 +292,7 @@ bool run_events(struct event_context *event_ctx,
                if (FD_ISSET(fde->fd, read_fds)) flags |= EVENT_FD_READ;
                if (FD_ISSET(fde->fd, write_fds)) flags |= EVENT_FD_WRITE;
 
-               if (flags) {
+               if (flags & fde->flags) {
                        fde->handler(event_ctx, fde, flags, fde->private_data);
                        fired = True;
                }