From 6454194b7c2c04f3c3cf6fdf3eb89e6973170207 Mon Sep 17 00:00:00 2001 From: michux Date: Wed, 15 Apr 2009 19:28:30 +0000 Subject: fix timestamp loop issue git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1027 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'timer.c') 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; } -- cgit v1.2.3