From: Alan T. DeKok Date: Mon, 21 Nov 2016 12:24:26 +0000 (-0500) Subject: Stop checking the event list if we're asked to exit X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d757f311bc6ea5b46a499c624fed6621d290af;p=thirdparty%2Ffreeradius-server.git Stop checking the event list if we're asked to exit --- diff --git a/src/lib/event.c b/src/lib/event.c index b4ced51542d..7024d2cc873 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -477,13 +477,17 @@ int fr_event_timer_run(fr_event_list_t *el, struct timeval *when) * * @param[in] el to process events for. * @param[in] wait if true, block on the kevent() call until a timer or file descriptor event occurs. - * @return the number of outstanding events. + * @return + * - <0 error, or the event loop is exiting + * - the number of outstanding events. */ int fr_event_corral(fr_event_list_t *el, bool wait) { struct timeval when, *wake; struct timespec ts_when, *ts_wake; + if (el->exit) return -1; + /* * Find the first event. If there's none, we wait * on the socket forever.