diff options
author | brian <brian@FreeBSD.org> | 1997-07-01 21:31:28 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-07-01 21:31:28 +0000 |
commit | 067015aaaee82b76de0d5b02d8947bd837c5b395 (patch) | |
tree | 0b553b7ea2fc6bd68ca1cff748d026ade2432cdb /usr.sbin | |
parent | 87c1696b92a3f849fe7793a676228df4eeae1e4d (diff) | |
download | FreeBSD-src-067015aaaee82b76de0d5b02d8947bd837c5b395.zip FreeBSD-src-067015aaaee82b76de0d5b02d8947bd837c5b395.tar.gz |
Make HUP cause an exit (as it used to), and make
INT cause a hangup - not exiting for -ddial & -auto.
HUP must exit because init sends this at system shutdown
time (why, I don't know), and we don't want to end up
redialing after the HUP (due to another dfilter packet).
Pointed out by and discussed with: ache
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/chat.c | 14 | ||||
-rw-r--r-- | usr.sbin/ppp/main.c | 10 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp.8 | 24 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp.8.m4 | 24 |
4 files changed, 17 insertions, 55 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c index 9c3984b..e1e14e7 100644 --- a/usr.sbin/ppp/chat.c +++ b/usr.sbin/ppp/chat.c @@ -18,7 +18,7 @@ * Columbus, OH 43221 * (614)451-1883 * - * $Id: chat.c,v 1.26 1997/06/09 03:27:15 brian Exp $ + * $Id: chat.c,v 1.27 1997/06/23 23:10:05 brian Exp $ * * TODO: * o Support more UUCP compatible control sequences. @@ -553,7 +553,7 @@ ExpectString(char *str) } static jmp_buf ChatEnv; -static void (*ohup)(int), (*oint)(int); +static void (*oint)(int); static void StopDial(int sig) @@ -569,16 +569,12 @@ DoChat(char *script) char **argv; int argc, n, state; - /* While we're chatting, we want a HUP/INT to fail us */ + /* While we're chatting, we want an INT to fail us */ if (setjmp(ChatEnv)) { - signal(SIGHUP, ohup); signal(SIGINT, oint); return(-1); } - ohup = signal(SIGHUP, SIG_IGN); - oint = signal(SIGINT, SIG_IGN); - signal(SIGHUP, StopDial); - signal(SIGINT, StopDial); + oint = signal(SIGINT, StopDial); timeout_next = abort_next = 0; for (n = 0; AbortStrings[n]; n++) { @@ -609,12 +605,10 @@ DoChat(char *script) HangupModem(); #endif case NOMATCH: - signal(SIGHUP, ohup); signal(SIGINT, oint); return(NOMATCH); } } - signal(SIGHUP, ohup); signal(SIGINT, oint); return(MATCH); } diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 36f6ee9..75ad657 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.67 1997/06/25 19:30:01 brian Exp $ + * $Id: main.c,v 1.68 1997/06/29 13:54:31 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -192,11 +192,11 @@ int excode; } static void -Hangup(signo) +CloseConnection(signo) int signo; { /* NOTE, these are manual, we've done a setsid() */ - LogPrintf(LogPHASE, "Hangup: Caught signal %d, abort connection\n", signo); + LogPrintf(LogPHASE, "Caught signal %d, abort connection\n", signo); reconnectState = RECON_FALSE; \ reconnectCount = 0; \ DownConnection(); @@ -366,9 +366,9 @@ char **argv; tcgetattr(0, &oldtio); /* Save original tty mode */ - pending_signal(SIGHUP, Hangup); + pending_signal(SIGHUP, CloseSession); pending_signal(SIGTERM, CloseSession); - pending_signal(SIGINT, CloseSession); + pending_signal(SIGINT, CloseConnection); pending_signal(SIGQUIT, CloseSession); #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8 index 94b19d9..96fd1c3 100644 --- a/usr.sbin/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp.8 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.42 1997/06/25 19:30:03 brian Exp $ +.\" $Id: ppp.8,v 1.43 1997/06/30 03:03:35 brian Exp $ .Dd 20 September 1995 .Os FreeBSD .Dt PPP 8 @@ -1267,7 +1267,7 @@ using deals with the following signals: .Bl -tag -width 20 -.It HUP +.It INT Receipt of this signal causes the termination of the current connection (if any). This will cause .Nm @@ -1275,25 +1275,9 @@ to exit unless it is in .Fl auto or .Fl ddial -mode. It should be noted that unless in -.Fl direct -mode, -.Nm -does not have a controlling terminal and therefore doesn't receive -this signal on loss of carrier. Instead, it monitors the line -directly for loss of carrier. - -.It INT -This signal will normally terminate -.Nm ppp . -If, however, -.Nm -is in interactive mode this signal will be ignored except when dialing. -When dialing, the signal causes -.Nm -to abort dialing and return to the command prompt. +mode. -.It TERM & QUIT +.It HUP, TERM & QUIT These signals tell .Nm to exit. diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4 index 94b19d9..96fd1c3 100644 --- a/usr.sbin/ppp/ppp.8.m4 +++ b/usr.sbin/ppp/ppp.8.m4 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.42 1997/06/25 19:30:03 brian Exp $ +.\" $Id: ppp.8,v 1.43 1997/06/30 03:03:35 brian Exp $ .Dd 20 September 1995 .Os FreeBSD .Dt PPP 8 @@ -1267,7 +1267,7 @@ using deals with the following signals: .Bl -tag -width 20 -.It HUP +.It INT Receipt of this signal causes the termination of the current connection (if any). This will cause .Nm @@ -1275,25 +1275,9 @@ to exit unless it is in .Fl auto or .Fl ddial -mode. It should be noted that unless in -.Fl direct -mode, -.Nm -does not have a controlling terminal and therefore doesn't receive -this signal on loss of carrier. Instead, it monitors the line -directly for loss of carrier. - -.It INT -This signal will normally terminate -.Nm ppp . -If, however, -.Nm -is in interactive mode this signal will be ignored except when dialing. -When dialing, the signal causes -.Nm -to abort dialing and return to the command prompt. +mode. -.It TERM & QUIT +.It HUP, TERM & QUIT These signals tell .Nm to exit. |