]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pluto: Use time_monotonic() instead of a custom implementation.
authorTobias Brunner <tobias@strongswan.org>
Thu, 22 Mar 2012 13:10:59 +0000 (14:10 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 27 Mar 2012 07:10:33 +0000 (09:10 +0200)
src/pluto/timer.c

index c1ad55f5e4c7e8bfd4de742442104a41b94ef9f1..1d34d2c54c35d11af875e7ec58960539b18668da 100644 (file)
  */
 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