]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Stop checking the event list if we're asked to exit
authorAlan T. DeKok <aland@freeradius.org>
Mon, 21 Nov 2016 12:24:26 +0000 (07:24 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 21 Nov 2016 14:01:22 +0000 (09:01 -0500)
src/lib/event.c

index b4ced51542dbf2b2c85385ae379efd00e061fffd..7024d2cc873c0eda14f9bb34305b500fc1babf5d 100644 (file)
@@ -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.