s3-events: If immediate requests are pending, the timeout is 0
authorVolker Lendecke <vl@samba.org>
Sat, 16 May 2009 13:42:53 +0000 (15:42 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 16 May 2009 17:22:03 +0000 (19:22 +0200)
source3/lib/events.c

index 90d86c6c79feac40d34e38ee94259d0ef7b52360..6fc3a9727bd96a2a0019987da07a53e64313e6a7 100644 (file)
@@ -70,6 +70,11 @@ bool event_add_to_select_args(struct tevent_context *ev,
                }
        }
 
+       if (ev->immediate_events != NULL) {
+               *timeout = timeval_zero();
+               return true;
+       }
+
        if (ev->timer_events == NULL) {
                return ret;
        }
@@ -140,6 +145,10 @@ struct timeval *get_timed_events_timeout(struct tevent_context *ev,
        if (ev->timer_events == NULL) {
                return NULL;
        }
+       if (ev->immediate_events != NULL) {
+               *to_ret = timeval_zero();
+               return to_ret;
+       }
 
        now = timeval_current();
        *to_ret = timeval_until(&now, &ev->timer_events->next_event);