diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2006-05-31 07:03:09 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2006-05-31 07:03:09 +0000 |
commit | 7963f0abb53ec62f3c41e04fa1238721e1793fd4 (patch) | |
tree | cceb23df2d4dee5cbe93fa2cecdab13b4cd87b0c /usr.bin/tip/tipout.c | |
parent | 3b7330873b07d1f4502badad6c5a8cff501b62b5 (diff) |
don't spin if the tty (think ucom) goes away
Diffstat (limited to 'usr.bin/tip/tipout.c')
-rw-r--r-- | usr.bin/tip/tipout.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c index a37e675a4b7..0ebe017276e 100644 --- a/usr.bin/tip/tipout.c +++ b/usr.bin/tip/tipout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tipout.c,v 1.17 2006/03/17 19:42:47 deraadt Exp $ */ +/* $OpenBSD: tipout.c,v 1.18 2006/05/31 07:03:08 jason Exp $ */ /* $NetBSD: tipout.c,v 1.5 1996/12/29 10:34:12 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: tipout.c,v 1.17 2006/03/17 19:42:47 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: tipout.c,v 1.18 2006/05/31 07:03:08 jason Exp $"; #endif /* not lint */ #include "tip.h" @@ -145,7 +145,7 @@ tipout(void) scnt = read(FD, buf, BUFSIZ); if (scnt <= 0) { /* lost carrier */ - if (scnt < 0 && errno == EIO) { + if (scnt == 0 || (scnt < 0 && errno == EIO)) { sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigprocmask(SIG_BLOCK, &mask, NULL); |