]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tevent: Ignore unexpected signal events in the same way the epoll backend does.
authorJeremy Allison <jra@samba.org>
Tue, 3 Mar 2015 00:17:54 +0000 (16:17 -0800)
committerStefan Metzmacher <metze@samba.org>
Wed, 4 Mar 2015 11:47:13 +0000 (12:47 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11118

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Mar  3 17:33:06 CET 2015 on sn-devel-104

(cherry picked from commit 7be3a5f92ddbb378a3c80e455cb7403f7861efa1)

lib/tevent/tevent_port.c

index 93e94b2158fd9a67ed3b28c4d34cfaa007a1eb04..dd4958e86aaa3bb26ae6afa5eda12246eb394d08 100644 (file)
@@ -483,10 +483,16 @@ static int port_event_loop(struct port_event_context *port_ev, struct timeval *t
        port_errno = errno;
        tevent_trace_point_callback(ev, TEVENT_TRACE_AFTER_WAIT);
 
-       if (ret == -1 && port_errno == EINTR && ev->signal_events) {
-               if (tevent_common_check_signal(ev)) {
-                       return 0;
+       if (ret == -1 && port_errno == EINTR) {
+               if (ev->signal_events) {
+                       tevent_common_check_signal(ev);
                }
+               /*
+                * If no signal handlers we got an unsolicited
+                * signal wakeup. This can happen with epoll
+                * too. Just return and ignore.
+                */
+               return 0;
        }
 
        if (ret == -1 && port_errno == ETIME && tvalp) {