diff options
author | brian <brian@FreeBSD.org> | 1997-05-10 01:22:19 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-05-10 01:22:19 +0000 |
commit | 82bac13560d095243e9988bfb770da73089749c1 (patch) | |
tree | 262cfd051516c08f29f6f133a950e9de9f2d42fd /usr.sbin/ppp/timer.c | |
parent | 1da867bda76bc701006945dfbc4733f550c91c2d (diff) | |
download | FreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.zip FreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.tar.gz |
Tidy up the code - bounds checking, return
value checking etc.
Submitted by: eivind
Diffstat (limited to 'usr.sbin/ppp/timer.c')
-rw-r--r-- | usr.sbin/ppp/timer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c index 116de6a..fbc46d9 100644 --- a/usr.sbin/ppp/timer.c +++ b/usr.sbin/ppp/timer.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: timer.c,v 1.14 1997/03/13 12:45:26 brian Exp $ + * $Id: timer.c,v 1.15 1997/05/09 20:48:21 brian Exp $ * * TODO: */ @@ -274,7 +274,9 @@ void InitTimerService( void ) { pending_signal(SIGALRM, (void (*)(int))TimerService); itimer.it_interval.tv_sec = itimer.it_value.tv_sec = 0; itimer.it_interval.tv_usec = itimer.it_value.tv_usec = TICKUNIT; - setitimer(ITIMER_REAL, &itimer, NULL); + if (setitimer(ITIMER_REAL, &itimer, NULL) == -1) { + logprintf("Unable to set itimer.\n"); + } } void TermTimerService( void ) { @@ -282,7 +284,9 @@ void TermTimerService( void ) { itimer.it_interval.tv_usec = itimer.it_interval.tv_sec = 0; itimer.it_value.tv_usec = itimer.it_value.tv_sec = 0; - setitimer(ITIMER_REAL, &itimer, NULL); + if (setitimer(ITIMER_REAL, &itimer, NULL) == -1) { + logprintf("Unable to set itimer.\n"); + } pending_signal(SIGALRM, SIG_IGN); } #endif |