From 008e2df4779d2153b96f2982d21a81abf4b1be93 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 22 Mar 2012 14:10:59 +0100 Subject: [PATCH] pluto: Use time_monotonic() instead of a custom implementation. --- src/pluto/timer.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/pluto/timer.c b/src/pluto/timer.c index c1ad55f5e4..1d34d2c54c 100644 --- a/src/pluto/timer.c +++ b/src/pluto/timer.c @@ -46,18 +46,7 @@ */ time_t now(void) { - static time_t delta = 0 - , last_time = 0; - time_t n = time(NULL); - - passert(n != (time_t)-1); - if (last_time > n) - { - plog("time moved backwards %ld seconds", (long)(last_time - n)); - delta += last_time - n; - } - last_time = n; - return n + delta; + return time_monotonic(NULL); } /* This file has the event handling routines. Events are