summaryrefslogtreecommitdiff
path: root/event.c
diff options
context:
space:
mode:
authoryongqing.jiao <yongqing.jiao@datayes.com>2017-12-09 14:39:07 +0800
committerAzat Khuzhin <a3at.mail@gmail.com>2017-12-11 00:10:23 +0300
commit6cce7458d0f94e320f201eb5be94866e6918d66c (patch)
tree17adf418036b73a7ebaea3c39a0a03ba40470b6e /event.c
parentbc65ffc14c62c10feffefe6c3d9975ce1d1a8cd8 (diff)
downloadlibevent-6cce7458d0f94e320f201eb5be94866e6918d66c.tar.gz
If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER
Fixes: 630f077c296de61c7b99ed83bf30de11e75e2740 ("Simple unit tests for monotonic timers")
Diffstat (limited to 'event.c')
-rw-r--r--event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/event.c b/event.c
index 98b1bc4a..3e24d3d4 100644
--- a/event.c
+++ b/event.c
@@ -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);