From: Tobias Brunner Date: Thu, 22 Mar 2012 13:10:59 +0000 (+0100) Subject: pluto: Use time_monotonic() instead of a custom implementation. X-Git-Tag: 4.6.3~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=008e2df4779d2153b96f2982d21a81abf4b1be93;p=thirdparty%2Fstrongswan.git pluto: Use time_monotonic() instead of a custom implementation. --- 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