From: Stefan Metzmacher Date: Mon, 16 Mar 2009 11:45:48 +0000 (+0100) Subject: tevent: check signal events first in event_loop_once X-Git-Tag: tdb-1.1.5~1075^2~104 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=0139befb915006d6ec9fec2734057c5c50b3c383 tevent: check signal events first in event_loop_once We also check for signal events directly before and after the select/epoll calls. metze --- diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c index 38a14883ccc..6c960c74918 100644 --- a/lib/tevent/tevent_epoll.c +++ b/lib/tevent/tevent_epoll.c @@ -404,6 +404,11 @@ static int epoll_event_loop_once(struct tevent_context *ev, const char *location struct epoll_event_context); struct timeval tval; + if (epoll_ev->ev->signal_events && + tevent_common_check_signal(epoll_ev->ev)) { + return 0; + } + tval = tevent_common_loop_timer_delay(ev); if (tevent_timeval_is_zero(&tval)) { return 0; diff --git a/lib/tevent/tevent_select.c b/lib/tevent/tevent_select.c index bbbb95fce8b..b666b4fba4a 100644 --- a/lib/tevent/tevent_select.c +++ b/lib/tevent/tevent_select.c @@ -210,6 +210,11 @@ static int select_event_loop_once(struct tevent_context *ev, const char *locatio struct select_event_context); struct timeval tval; + if (select_ev->ev->signal_events && + tevent_common_check_signal(select_ev->ev)) { + return 0; + } + tval = tevent_common_loop_timer_delay(ev); if (tevent_timeval_is_zero(&tval)) { return 0; diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c index 0ee99ca56b2..40a08d7ab08 100644 --- a/lib/tevent/tevent_standard.c +++ b/lib/tevent/tevent_standard.c @@ -524,6 +524,11 @@ static int std_event_loop_once(struct tevent_context *ev, const char *location) struct std_event_context); struct timeval tval; + if (std_ev->ev->signal_events && + tevent_common_check_signal(std_ev->ev)) { + return 0; + } + tval = tevent_common_loop_timer_delay(ev); if (tevent_timeval_is_zero(&tval)) { return 0;