-rw-r--r-- | core/opiealarm/opiealarm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/opiealarm/opiealarm.c b/core/opiealarm/opiealarm.c index 998cabd..90a743f 100644 --- a/core/opiealarm/opiealarm.c +++ b/core/opiealarm/opiealarm.c @@ -90,12 +90,13 @@ int fork_with_pidfile ( void ) exit ( 0 ); } else if ( pid < 0 ) { perror ( "forking failed" ); return 0; } + // sleep( 60 ); // child process needs to react to SIGUSR2. This is sent when // a new opiealarm process is started. signal ( SIGUSR2, sig_handler_child ); @@ -203,13 +204,13 @@ int main ( int argc, char **argv ) return opt; } int suspend ( int fix_rtc ) { - FILE *fp; + FILE *fp = NULL; char buf [64]; time_t alrt, syst, rtct; struct tm alr, sys, rtc; int fd; int rtc_sys_diff; @@ -255,13 +256,13 @@ int suspend ( int fix_rtc ) break; // ( 1, TIMEFILE ); if ( !fgets ( buf, sizeof( buf ) - 1, fp )) break; // ( 1, TIMEFILE ); fclose ( fp ); - fp = 0; + fp = NULL; alrt = atoi ( buf ); // get the alarm time if ( alrt == 0 ) break; // ( 0, TIMEFILE " contains an invalid time description" ); alrt -= 5; // wake up 5 sec before the specified time |