I finally had enough of tip not recognizing carrier loss. now it does.

This commit is contained in:
Poul-Henning Kamp 1994-09-29 02:22:08 +00:00
parent 93e010b0fd
commit 96a1d4decb
3 changed files with 17 additions and 0 deletions

View File

@ -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 @@ main(argc, argv)
(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

View File

@ -276,3 +276,5 @@ extern int disc; /* current tty discpline */
extern char *ctrl();
extern char *vinterp();
extern char *connect();
int tipabort __P((char *));

View File

@ -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;
}