diff options
author | bde <bde@FreeBSD.org> | 1995-05-07 06:32:28 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-05-07 06:32:28 +0000 |
commit | 562a666ce0ac9a6d3ffad1a6040cf8c9424628df (patch) | |
tree | 62018c522373e2833a1055122a27fed990102647 /sys/kern/tty.c | |
parent | 618d4ca72be5beded1771c601ea3261d8040b840 (diff) | |
download | FreeBSD-src-562a666ce0ac9a6d3ffad1a6040cf8c9424628df.zip FreeBSD-src-562a666ce0ac9a6d3ffad1a6040cf8c9424628df.tar.gz |
Test the correct nonblocking flag in ttylclose(). IO_NDELAY is only valid
in read() and write(). FNONBLOCK is valid in ioctl() and close().
The bug caused hung ptys when a process talked to itself using nonblocking
i/o and exited while the slave pty had output to flush. ttywait() was
called and hung. Signals didn't work because the process was exiting.
`comcontrol /dev/ttyp0 drainwait 1' worked to terminate the wait. This
shows that comcontrol is not limited to hardware control. It has no i386
or driver dependencies and doesn't belong in src/sbin/i386.
Bruce
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 94a4770..11c0a3f 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.41 1995/03/29 19:24:46 ache Exp $ + * $Id: tty.c,v 1.42 1995/04/15 21:04:58 bde Exp $ */ #include "snp.h" @@ -1196,7 +1196,7 @@ ttylclose(tp, flag) int flag; { - if ((flag & IO_NDELAY) || ttywflush(tp)) + if (flag & FNONBLOCK || ttywflush(tp)) ttyflush(tp, FREAD | FWRITE); return (0); } |