]> git.webhop.me Git - lcd4linux.git/commitdiff
fix timestamp loop issue
authormichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 15 Apr 2009 19:28:30 +0000 (19:28 +0000)
committermichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 15 Apr 2009 19:28:30 +0000 (19:28 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1027 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

timer.c

diff --git a/timer.c b/timer.c
index 355538bebcda512017cf0ef0360958322ba57f60..f313a3600f676f8a42d3051458b7308a16b08dc7 100644 (file)
--- a/timer.c
+++ b/timer.c
@@ -178,6 +178,14 @@ int timer_process(struct timespec *delay)
     /* nanoseconds!! */
     delay->tv_nsec *= 1000;
 
+    /* check if date changed*/
+    if ((delay->tv_sec) > 1) { 
+            delay->tv_sec = 0; 
+            warn("Oops, clock skewed, update timestamp");
+           gettimeofday(&now, NULL);
+            Timers[min].when = now;
+    }
+    
     return 0;
 
 }