summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-06-03 12:55:19 -0700
committerKarolin Seeger <kseeger@samba.org>2011-06-07 20:04:19 +0200
commit709ef6bdda3e86892437c79880cfdefcc0f4363c (patch)
tree5d67572d6643a7ebe628354623090df97568fd50
parent9546457783e89514d5be5a7a168f19152ffa6a21 (diff)
downloadsamba-709ef6bdda3e86892437c79880cfdefcc0f4363c.tar.gz
Add the same fix to the S3 event backend as the previous commit added to the tevent poll backend.
Metze please check ! Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Jun 4 00:27:37 CEST 2011 on sn-devel-104 (cherry picked from commit 3c9b3b2befc524f21c59f46ea9be1602b4b1bfe8) (cherry picked from commit 017f84a07dedf700c25da253ac7247633b616056)
-rw-r--r--source3/lib/events.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 9ff14880ecd..fbe3db942b4 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -258,7 +258,20 @@ bool run_events_poll(struct tevent_context *ev, int pollrtn,
return false;
}
- if (pfd->revents & (POLLIN|POLLHUP|POLLERR)) {
+ if (pfd->revents & (POLLHUP|POLLERR)) {
+ /* If we only wait for EVENT_FD_WRITE, we
+ should not tell the event handler about it,
+ and remove the writable flag, as we only
+ report errors when waiting for read events
+ to match the select behavior. */
+ if (!(fde->flags & EVENT_FD_READ)) {
+ EVENT_FD_NOT_WRITEABLE(fde);
+ continue;
+ }
+ flags |= EVENT_FD_READ;
+ }
+
+ if (pfd->revents & POLLIN) {
flags |= EVENT_FD_READ;
}
if (pfd->revents & POLLOUT) {