aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--timer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/timer.c b/timer.c
index 355538b..f313a36 100644
--- 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;
}