diff options
author | Richard Braun <rbraun@sceen.net> | 2013-10-14 20:48:25 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-10-14 20:50:55 +0200 |
commit | 1cfdceba98c380ad1cebb3a6b3d1f141d852c691 (patch) | |
tree | ba4d7c387653e0b004f1ce995f6696694a6d847e | |
parent | ef6f49570c748bed2c086faecec9064b9b04514a (diff) |
term: fix read on a closed PTY
* term/ptyio.c (pty_io_read): Return EIO if the terminal has been closed.
-rw-r--r-- | term/ptyio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/term/ptyio.c b/term/ptyio.c index 44a215bb..2da7d6c8 100644 --- a/term/ptyio.c +++ b/term/ptyio.c @@ -331,6 +331,12 @@ pty_io_read (struct trivfs_protid *cred, } } + if (!(termflags & TTY_OPEN)) + { + pthread_mutex_unlock (&global_lock); + return EIO; + } + if (control_byte) { size = 1; |