I finally had enough of tip not recognizing carrier loss. now it does.
This commit is contained in:
parent
93e010b0fd
commit
96a1d4decb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3184
@ -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
|
||||
|
@ -276,3 +276,5 @@ extern int disc; /* current tty discpline */
|
||||
extern char *ctrl();
|
||||
extern char *vinterp();
|
||||
extern char *connect();
|
||||
|
||||
int tipabort __P((char *));
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user