diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1994-09-29 02:22:08 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1994-09-29 02:22:08 +0000 |
commit | 96a1d4decb031e15c26f240263906bc16496232a (patch) | |
tree | e5fa221e04d0000c279eef8498dbbded97e30430 /usr.bin/tip | |
parent | 93e010b0fd1c4e43bed7d891ac13aa6a76231c87 (diff) | |
download | src-96a1d4decb031e15c26f240263906bc16496232a.tar.gz src-96a1d4decb031e15c26f240263906bc16496232a.zip |
I finally had enough of tip not recognizing carrier loss. now it does.
Notes
Notes:
svn path=/head/; revision=3184
Diffstat (limited to 'usr.bin/tip')
-rw-r--r-- | usr.bin/tip/tip.c | 7 | ||||
-rw-r--r-- | usr.bin/tip/tip.h | 2 | ||||
-rw-r--r-- | usr.bin/tip/tipout.c | 8 |
3 files changed, 17 insertions, 0 deletions
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c index 1745faa57ba0..0d84e75ff168 100644 --- a/usr.bin/tip/tip.c +++ b/usr.bin/tip/tip.c @@ -62,6 +62,7 @@ int disc = OTTYDISC; /* tip normally runs this way */ void intprompt(); void timeout(); void cleanup(); +void tipdone(); char *sname(); char PNbuf[256]; /* This limits the size of a number */ @@ -138,6 +139,7 @@ notnumber: (void)signal(SIGQUIT, cleanup); (void)signal(SIGHUP, cleanup); (void)signal(SIGTERM, cleanup); + (void)signal(SIGUSR1, tipdone); if ((i = hunt(system)) == 0) { printf("all ports busy\n"); @@ -237,6 +239,11 @@ cleanup() exit(0); } +void +tipdone() +{ + tipabort("Hangup."); +} /* * Muck with user ID's. We are setuid to the owner of the lock * directory when we start. user_uid() reverses real and effective diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h index 403e17f90c61..f1b833d74203 100644 --- a/usr.bin/tip/tip.h +++ b/usr.bin/tip/tip.h @@ -276,3 +276,5 @@ extern int disc; /* current tty discpline */ extern char *ctrl(); extern char *vinterp(); extern char *connect(); + +int tipabort __P((char *)); diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c index 7288eb82c99c..246cfb7d67f9 100644 --- a/usr.bin/tip/tipout.c +++ b/usr.bin/tip/tipout.c @@ -136,6 +136,14 @@ tipout() sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ + } else if (cnt == 0 && errno == ENOENT) { + kill(getppid(),SIGUSR1); + sigblock(sigmask(SIGTERM)); + intTERM(); + /*NOTREACHED*/ + } else { + printf("%d %d\r",cnt,errno); + fflush(stdout); } continue; } |