diff options
author | brian <brian@FreeBSD.org> | 1997-03-13 12:45:35 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-03-13 12:45:35 +0000 |
commit | db1507dc21cd44caa52ead85f9a6a42d0d986982 (patch) | |
tree | fa504756c008684108eea2200c879f5791919788 /usr.sbin/ppp/main.c | |
parent | d595a2d0872984b79873b4152ae4550b61e185a6 (diff) | |
download | FreeBSD-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/main.c')
-rw-r--r-- | usr.sbin/ppp/main.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 0e39301..6e83847 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.36 1997/03/09 20:03:39 ache Exp $ + * $Id: main.c,v 1.37 1997/03/10 06:21:01 ache Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -49,6 +49,7 @@ #include "systems.h" #include "ip.h" #include "alias.h" +#include "sig.h" #define LAUTH_M1 "Warning: No password entry for this host in ppp.secret\n" #define LAUTH_M2 "Warning: All manipulation is allowed by anyone in the world\n" @@ -213,8 +214,8 @@ int signo; static void TerminalCont() { - (void)signal(SIGCONT, SIG_DFL); - (void)signal(SIGTSTP, TerminalStop); + pending_signal(SIGCONT, SIG_DFL); + pending_signal(SIGTSTP, TerminalStop); TtyCommandMode(getpgrp() == tcgetpgrp(0)); } @@ -222,9 +223,9 @@ static void TerminalStop(signo) int signo; { - (void)signal(SIGCONT, TerminalCont); + pending_signal(SIGCONT, TerminalCont); TtyOldMode(); - signal(SIGTSTP, SIG_DFL); + pending_signal(SIGTSTP, SIG_DFL); kill(getpid(), signo); } @@ -349,9 +350,9 @@ char **argv; tcgetattr(0, &oldtio); /* Save original tty mode */ signal(SIGHUP, Hangup); - signal(SIGTERM, CloseSession); - signal(SIGINT, CloseSession); - signal(SIGQUIT, CloseSession); + pending_signal(SIGTERM, CloseSession); + pending_signal(SIGINT, CloseSession); + pending_signal(SIGQUIT, CloseSession); #ifdef SIGSEGV signal(SIGSEGV, Hangup); #endif @@ -359,18 +360,18 @@ char **argv; signal(SIGPIPE, Hangup); #endif #ifdef SIGALRM - signal(SIGALRM, SIG_IGN); + pending_signal(SIGALRM, SIG_IGN); #endif if(mode & MODE_INTER) { #ifdef SIGTSTP - signal(SIGTSTP, TerminalStop); + pending_signal(SIGTSTP, TerminalStop); #endif #ifdef SIGTTIN - signal(SIGTTIN, TerminalStop); + pending_signal(SIGTTIN, TerminalStop); #endif #ifdef SIGTTOU - signal(SIGTTOU, SIG_IGN); + pending_signal(SIGTTOU, SIG_IGN); #endif } @@ -796,6 +797,8 @@ DoLoop() #ifndef SIGALRM usleep(TICKUNIT); TimerService(); +#else + handle_signals(); #endif /* If there are aren't many packets queued, look for some more. */ @@ -836,7 +839,8 @@ DoLoop() if ( i < 0 ) { if ( errno == EINTR ) { - continue; /* Got a signal - should have been dealt with */ + handle_signals(); + continue; } perror("select"); break; |