diff options
author | Bruce Evans <bde@FreeBSD.org> | 1995-05-07 06:32:28 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1995-05-07 06:32:28 +0000 |
commit | 65e8f1183955109de7cd24652a1a4186e42ddbbf (patch) | |
tree | 62018c522373e2833a1055122a27fed990102647 /sys/kern/tty.c | |
parent | 2b0e7dfa1372ac3a10b57bb39454e7b80d12dd87 (diff) | |
download | src-65e8f1183955109de7cd24652a1a4186e42ddbbf.tar.gz src-65e8f1183955109de7cd24652a1a4186e42ddbbf.zip |
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
Notes
Notes:
svn path=/head/; revision=8318
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 94a47707e2fc..11c0a3f45217 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); } |