From 1cfdceba98c380ad1cebb3a6b3d1f141d852c691 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Mon, 14 Oct 2013 20:48:25 +0200 Subject: term: fix read on a closed PTY * term/ptyio.c (pty_io_read): Return EIO if the terminal has been closed. --- term/ptyio.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3