summaryrefslogtreecommitdiffstats
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-09-29 02:22:08 +0000
committerphk <phk@FreeBSD.org>1994-09-29 02:22:08 +0000
commite9600855b708ccbf583f1ea559b8b2e58b93c539 (patch)
treee5fa221e04d0000c279eef8498dbbded97e30430 /usr.bin/tip
parent3418b20e52d057b509376ac4df4cda6d5feafde6 (diff)
downloadFreeBSD-src-e9600855b708ccbf583f1ea559b8b2e58b93c539.zip
FreeBSD-src-e9600855b708ccbf583f1ea559b8b2e58b93c539.tar.gz
I finally had enough of tip not recognizing carrier loss. now it does.
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/tip.c7
-rw-r--r--usr.bin/tip/tip.h2
-rw-r--r--usr.bin/tip/tipout.c8
3 files changed, 17 insertions, 0 deletions
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c
index 1745faa..0d84e75 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 403e17f..f1b833d 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 7288eb8..246cfb7 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;
}
OpenPOWER on IntegriCloud