[vdr] New shutdown procedure not working as expected

Udo Richter udo_richter at gmx.de
Thu Aug 2 00:07:07 CEST 2007

Petri Helin wrote:
> I traced the problem to the SystemExec call in 
> cShutdownHandler::CallShutdownCommand where Setup.NextWakeupTime is 
> updated only if the SystemExec call returns 0. i changed it to accept 
> all values greater or equal to 0 and now Setup.NextWakeupTime gets 
> updated properly. Can some explain me why 0 is expected?

SystemExec called with true as second parameter should only return -1 in 
case of an error (logged to syslog) or the status of waitpid() in case 
of success. (see thread.c) Since the direct child instantly does 
exit(0), I assumed that status should also be 0.

On the other hand, the man page of waitpid mentions lots of macros to 
inspect the status return of waitpid. Maybe checking on these helps here.



More information about the vdr mailing list