Josce Unknown wrote:
I am sure this would fix the problem. However, is this really the way it should work?
The clock is four minutes off, let's PANIC?

VDR still defaults to start recordings three minutes before scheduled time, right? I wouldn't want to rely my recordings on a clock that is that bad.

To be honest, I have seen a lot of worse PC clocks around than the one I have on my spare computer ...

The worst I had was on a 286, running 40s off per day. Good thing that this is over. Today, I would count one or two minutes per month as worst acceptable.

Back on the issue:

I've just tested this on my machine, with a small program that uses the alarm() to sleep for 10 seconds, just as the watchdog uses alarm(). (Code is attached.)
This is a normal run:

#>date ; ./alarm ; date
Sa 9. Jun 11:50:36 CEST 2007
Sa 9. Jun 11:50:46 CEST 2007

The second run, I started the program at 11:52:55, and at 11:53 I manually changed the clock to 11:54. This is what happened:

#>date ; ./alarm ; date
Sa 9. Jun 11:52:55 CEST 2007
Sa 9. Jun 11:54:04 CEST 2007

Just as I've expected: alarm() runs independent of any system clocks, it always waits the specified time in seconds. There should be no reason to modify the behavior of the watchdog, since alarm() doesn't care about the calendar clock.

Btw: Even ntpd would step the clock in this case, because clock slew is only used for time offsets of less than 128ms.

And, from the original post:
May 31 20:23:38 localhost vdr: [3413] System Time = Thu May 31 20:23:38 2007 
May 31 20:23:38 localhost vdr: [3413] Local Time = Thu May 31 20:19:37 2007 
May 31 20:21:01 localhost vdr: [3405] PANIC: watchdog timer expired - exiting!

The clock was set to 20:19:37, and the watchdog fires at 20:21:01 - 84 seconds later. There must be something different causing the watchdog to expire.



#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

static void Watchdog(int signum)

int main(int argc, char *argv[])
    if (signal(SIGALRM, Watchdog)   == SIG_IGN) signal(SIGALRM, SIG_IGN);
    while (true) sleep(1);
vdr mailing list

Reply via email to