2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Use a monotonic timer for the event subsystem.

This commit is contained in:
Todd C. Miller
2018-08-25 21:02:06 -06:00
parent 04d1f56d90
commit 6b76f9dbd3
3 changed files with 5 additions and 6 deletions

View File

@@ -200,7 +200,7 @@ sudo_ev_scan_impl(struct sudo_event_base *base, int flags)
debug_decl(sudo_ev_loop, SUDO_DEBUG_EVENT)
if ((ev = TAILQ_FIRST(&base->timeouts)) != NULL) {
sudo_gettime_real(&now);
sudo_gettime_mono(&now);
sudo_timespecsub(&ev->timeout, &now, &ts);
if (ts.tv_sec < 0 || (ts.tv_sec == 0 && ts.tv_nsec < 0))
sudo_timespecclear(&ts);