diff options
Diffstat (limited to 'usr.bin/tip')
-rw-r--r-- | usr.bin/tip/tip/tip.c | 2 | ||||
-rw-r--r-- | usr.bin/tip/tip/tipout.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/tip/tip/tip.c b/usr.bin/tip/tip/tip.c index 058a99b..066d679 100644 --- a/usr.bin/tip/tip/tip.c +++ b/usr.bin/tip/tip/tip.c @@ -584,7 +584,7 @@ parwrite(int fd, char *buf, size_t n) bp++; } if (write(fd, buf, n) < 0) { - if (errno == EIO) + if (errno == EIO || errno == ENXIO) tipabort("Lost carrier."); /* this is questionable */ perror("write"); diff --git a/usr.bin/tip/tip/tipout.c b/usr.bin/tip/tip/tipout.c index 3dff3bd..db6afe4 100644 --- a/usr.bin/tip/tip/tipout.c +++ b/usr.bin/tip/tip/tipout.c @@ -148,11 +148,12 @@ tipout(void) scnt = read(FD, buf, BUFSIZ); if (scnt <= 0) { /* lost carrier */ - if (scnt == 0 || (scnt < 0 && errno == EIO)) { + if (scnt == 0 || + (scnt < 0 && (errno == EIO || errno == ENXIO))) { sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigprocmask(SIG_BLOCK, &mask, NULL); - intTERM(0); + intTERM(SIGHUP); /*NOTREACHED*/ } continue; |