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/ppp/chat.c | |
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/ppp/chat.c')
-rw-r--r-- | usr.sbin/ppp/chat.c | 14 |
1 files changed, 4 insertions, 10 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); } |