summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/timer.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-03-13 12:45:35 +0000
committerbrian <brian@FreeBSD.org>1997-03-13 12:45:35 +0000
commitdb1507dc21cd44caa52ead85f9a6a42d0d986982 (patch)
treefa504756c008684108eea2200c879f5791919788 /usr.sbin/ppp/timer.c
parentd595a2d0872984b79873b4152ae4550b61e185a6 (diff)
downloadFreeBSD-src-db1507dc21cd44caa52ead85f9a6a42d0d986982.zip
FreeBSD-src-db1507dc21cd44caa52ead85f9a6a42d0d986982.tar.gz
Reviewed by: ache@freebsd.org
These changes should fix the signal "problems" in ppp. The signal changes should really be put into 2.2 too ! The following patches should do it. There were some other changes made by Andrey recently that havn't been brought into 2.2, it may be worth doing them now.
Diffstat (limited to 'usr.sbin/ppp/timer.c')
-rw-r--r--usr.sbin/ppp/timer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 629da58..8460992 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.12 1997/03/09 20:03:51 ache Exp $
+ * $Id: timer.c,v 1.13 1997/03/09 20:09:17 ache Exp $
*
* TODO:
*/
@@ -28,6 +28,8 @@
#ifdef SIGALRM
#include <errno.h>
#endif
+#include "sig.h"
+
void StopTimerNoBlock( struct pppTimer *);
void ShowTimers(void);
@@ -269,7 +271,7 @@ void usleep( u_int usec)
void InitTimerService( void ) {
struct itimerval itimer;
- signal(SIGALRM, (void (*)(int))TimerService);
+ 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);
@@ -278,13 +280,8 @@ void InitTimerService( void ) {
void TermTimerService( void ) {
struct itimerval itimer;
- itimer.it_interval.tv_sec = itimer.it_value.tv_sec = 0;
itimer.it_value.tv_usec = itimer.it_value.tv_sec = 0;
setitimer(ITIMER_REAL, &itimer, NULL);
- /*
- * Notes: after disabling timer here, we will get one
- * SIGALRM will be got.
- */
- signal(SIGALRM, SIG_IGN);
+ pending_signal(SIGALRM, SIG_IGN);
}
#endif
OpenPOWER on IntegriCloud