summaryrefslogtreecommitdiff
path: root/term
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-12-27 16:56:08 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-12-27 16:56:08 +0100
commitd88bebe601742481f5b244e08c0fa442ddbefbf2 (patch)
tree70fd61e4bba464aafb7c339e0e5c46a064936dac /term
parent7a9e7c30ba5f80b1e176a84b21094813893178bd (diff)
Fix 0-length reads from tty
* term/users.c (trivfs_S_io_read): Immediately return 0 also when `amount' is 0.
Diffstat (limited to 'term')
-rw-r--r--term/users.c2
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);