Skip to content

Commit

Permalink
If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_T…
Browse files Browse the repository at this point in the history
…IMER

Fixes: 630f077 ("Simple unit tests for
monotonic timers")
  • Loading branch information
yongqing.jiao authored and azat committed Dec 10, 2017
1 parent bc65ffc commit 6cce745
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion event.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ event_base_new_with_config(const struct event_config *cfg)
int flags;
if (should_check_environment && !precise_time) {
precise_time = evutil_getenv_("EVENT_PRECISE_TIMER") != NULL;
base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
if (precise_time) {
base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
}
}
flags = precise_time ? EV_MONOT_PRECISE : 0;
evutil_configure_monotonic_time_(&base->monotonic_timer, flags);
Expand Down

0 comments on commit 6cce745

Please sign in to comment.