diff options
author | michux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-04-15 19:28:30 +0000 |
---|---|---|
committer | michux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-04-15 19:28:30 +0000 |
commit | 6454194b7c2c04f3c3cf6fdf3eb89e6973170207 (patch) | |
tree | 14d898ee8303c87f1d3137f7ee248edf916364ab | |
parent | 170141385587d8e51728a9abf0b1f9f02ea0b22e (diff) | |
download | lcd4linux-6454194b7c2c04f3c3cf6fdf3eb89e6973170207.tar.gz |
fix timestamp loop issue
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1027 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r-- | timer.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; } |