From d88bebe601742481f5b244e08c0fa442ddbefbf2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 27 Dec 2011 16:56:08 +0100 Subject: Fix 0-length reads from tty * term/users.c (trivfs_S_io_read): Immediately return 0 also when `amount' is 0. --- term/users.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'term') diff --git a/term/users.c b/term/users.c index a4e110b4..4ec2b810 100644 --- a/term/users.c +++ b/term/users.c @@ -678,7 +678,7 @@ trivfs_S_io_read (struct trivfs_protid *cred, while (!qsize (inputq)) { - if ((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL)) + if ((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL) || !amount) { /* Return EOF, Posix.1 7.1.1.10. */ mutex_unlock (&global_lock); -- cgit v1.2.3