diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-12-27 16:56:08 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-12-27 16:56:08 +0100 |
commit | d88bebe601742481f5b244e08c0fa442ddbefbf2 (patch) | |
tree | 70fd61e4bba464aafb7c339e0e5c46a064936dac | |
parent | 7a9e7c30ba5f80b1e176a84b21094813893178bd (diff) |
Fix 0-length reads from tty
* term/users.c (trivfs_S_io_read): Immediately return 0 also when `amount' is 0.
-rw-r--r-- | term/users.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |