summaryrefslogtreecommitdiff
path: root/term
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-04 20:51:05 +0000
committerMiles Bader <miles@gnu.org>1996-10-04 20:51:05 +0000
commitb8172cac10eb5943110003826de210ecf0e7e106 (patch)
tree8c441bf3e0b3856dbea739963e0a97295237c46f /term
parenta51b73384765caf52a25b53ad66126b354012302 (diff)
(pty_open_hook): Reinitialize pty variables.
(pty_io_select): Return SELECT_READ if the slave isn't open. (pty_io_read): If the slave isn't open, return EOF.
Diffstat (limited to 'term')
-rw-r--r--term/ptyio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/term/ptyio.c b/term/ptyio.c
index d032eab3..4cc8916f 100644
--- a/term/ptyio.c
+++ b/term/ptyio.c
@@ -80,7 +80,13 @@ pty_open_hook (struct trivfs_control *cntl,
}
ptyopen = 1;
+ packet_mode = 0;
+ user_ioctl_mode = 0;
+ control_byte = 0;
+ pktnostop = 0;
+
mutex_unlock (&global_lock);
+
return 0;
}
@@ -292,6 +298,7 @@ pty_io_read (struct trivfs_protid *cred,
}
while (!control_byte
+ && (termflags & TTY_OPEN)
&& (!qsize (outputq) || (termflags & USER_OUTPUT_SUSP)))
{
if (cred->po->openmodes & O_NONBLOCK)
@@ -446,7 +453,8 @@ pty_io_select (struct trivfs_protid *cred, mach_port_t reply,
while (1)
{
- if ((*type & SELECT_READ) && (control_byte || qsize (outputq)))
+ if ((*type & SELECT_READ)
+ && (control_byte || qsize (outputq) || !(termflags & TTY_OPEN)))
avail |= SELECT_READ;
if ((*type & SELECT_URG) && control_byte)