diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-07 20:41:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-07 20:41:22 +0000 |
commit | 0935a6f0d18ca78dc00225cf5b0e9b4284c16045 (patch) | |
tree | 25a4beed17a6aee767236aae9b1aebf06dd1150d /usr.bin | |
parent | c573ceb3977e998e829b59641a054b0d773fca69 (diff) |
Treat EPIPE writing to the terminal the same as SIGQUIT from the user.
Closes PR 3016.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/telnet/terminal.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/telnet/terminal.c b/usr.bin/telnet/terminal.c index b026bb694b8..9f82b9e784e 100644 --- a/usr.bin/telnet/terminal.c +++ b/usr.bin/telnet/terminal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: terminal.c,v 1.4 2001/11/19 19:02:16 mpech Exp $ */ +/* $OpenBSD: terminal.c,v 1.5 2002/12/07 20:41:21 millert Exp $ */ /* $NetBSD: terminal.c,v 1.5 1996/02/28 21:04:17 thorpej Exp $ */ /* @@ -138,8 +138,11 @@ ttyflush(drop) } ring_consumed(&ttyoring, n); } - if (n < 0) + if (n < 0) { + if (errno == EPIPE) + kill(0, SIGQUIT); return -1; + } if (n == n0) { if (n0) return -1; |