summaryrefslogtreecommitdiff
path: root/core/opiealarm
authorzecke <zecke>2003-06-13 10:41:14 (UTC)
committer zecke <zecke>2003-06-13 10:41:14 (UTC)
commit60ba51b33a060dde352caa678f2e337f5f5590f5 (patch) (unidiff)
tree29da8884e438bb768f2d0a5f41dbaad62ce7776c /core/opiealarm
parent3dd3e5caf9ca85c814442b04485f07da060dc257 (diff)
downloadopie-60ba51b33a060dde352caa678f2e337f5f5590f5.zip
opie-60ba51b33a060dde352caa678f2e337f5f5590f5.tar.gz
opie-60ba51b33a060dde352caa678f2e337f5f5590f5.tar.bz2
fix here as well
Diffstat (limited to 'core/opiealarm') (more/less context) (ignore whitespace changes)
-rw-r--r--core/opiealarm/opiealarm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/opiealarm/opiealarm.c b/core/opiealarm/opiealarm.c
index 072dca7..465e633 100644
--- a/core/opiealarm/opiealarm.c
+++ b/core/opiealarm/opiealarm.c
@@ -89,13 +89,13 @@ int fork_with_pidfile ( void )
89 sleep ( 1000 ); 89 sleep ( 1000 );
90 exit ( 0 ); 90 exit ( 0 );
91 } 91 }
92 else if ( pid < 0 ) { 92 else if ( pid < 0 ) {
93 perror ( "forking failed" ); 93 perror ( "forking failed" );
94 return 0; 94 return 0;
95 } 95 }
96 96
97 // child process needs to react to SIGUSR2. This is sent when 97 // child process needs to react to SIGUSR2. This is sent when
98 // a new opiealarm process is started. 98 // a new opiealarm process is started.
99 99
100 signal ( SIGUSR2, sig_handler_child ); 100 signal ( SIGUSR2, sig_handler_child );
101 101
@@ -255,12 +255,13 @@ int suspend ( int fix_rtc )
255 break; // ( 1, TIMEFILE ); 255 break; // ( 1, TIMEFILE );
256 256
257 if ( !fgets ( buf, sizeof( buf ) - 1, fp )) 257 if ( !fgets ( buf, sizeof( buf ) - 1, fp ))
258 break; // ( 1, TIMEFILE ); 258 break; // ( 1, TIMEFILE );
259 259
260 fclose ( fp ); 260 fclose ( fp );
261 fp = 0;
261 262
262 alrt = atoi ( buf ); // get the alarm time 263 alrt = atoi ( buf ); // get the alarm time
263 264
264 if ( alrt == 0 ) 265 if ( alrt == 0 )
265 break; // ( 0, TIMEFILE " contains an invalid time description" ); 266 break; // ( 0, TIMEFILE " contains an invalid time description" );
266 alrt -= 5; // wake up 5 sec before the specified time 267 alrt -= 5; // wake up 5 sec before the specified time
@@ -283,12 +284,13 @@ int suspend ( int fix_rtc )
283 // from the "resume instance" of opiealarm. 284 // from the "resume instance" of opiealarm.
284 285
285 if ( ioctl ( fd, RTC_AIE_OFF, 0 ) < 0 ) // disable RTC alarm irq 286 if ( ioctl ( fd, RTC_AIE_OFF, 0 ) < 0 ) // disable RTC alarm irq
286 break; // ( 1, "ioctl RTC_AIE_OFF" ); 287 break; // ( 1, "ioctl RTC_AIE_OFF" );
287 288
288 close ( fd ); 289 close ( fd );
290 fd = -1;
289 291
290 remove_pidfile ( ); 292 remove_pidfile ( );
291 293
292 return 0; 294 return 0;
293 295
294 } while ( 0 ); 296 } while ( 0 );