Skip to content

Commit

Permalink
Stop checking the event list if we're asked to exit
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Nov 21, 2016
1 parent 0ce512f commit 31d757f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 31d757f

Please sign in to comment.