1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3:lib/events: Fix a bug in run_poll_events().

Ignore fd events without EVENT_FD_READ or EVENT_FD_WRITE also in
run_events_poll(). They are ignore when building the array
for the syscall in event_add_to_poll_args(), so we need to
ignore them run_events_poll() too.

metze

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Aug  9 10:11:54 CEST 2011 on sn-devel-104
This commit is contained in:
Stefan Metzmacher 2011-08-08 18:49:06 +02:00
parent abd2e25ee0
commit 020032e114

View File

@ -243,6 +243,10 @@ bool run_events_poll(struct tevent_context *ev, int pollrtn,
struct pollfd *pfd; struct pollfd *pfd;
uint16 flags = 0; uint16 flags = 0;
if ((fde->flags & (EVENT_FD_READ|EVENT_FD_WRITE)) == 0) {
continue;
}
if (pollfd_idx[fde->fd] >= num_pfds) { if (pollfd_idx[fde->fd] >= num_pfds) {
DEBUG(1, ("internal error: pollfd_idx[fde->fd] (%d) " DEBUG(1, ("internal error: pollfd_idx[fde->fd] (%d) "
">= num_pfds (%d)\n", pollfd_idx[fde->fd], ">= num_pfds (%d)\n", pollfd_idx[fde->fd],