summaryrefslogtreecommitdiff
path: root/term/users.c
diff options
context:
space:
mode:
Diffstat (limited to 'term/users.c')
-rw-r--r--term/users.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/term/users.c b/term/users.c
index cf89fee5..9396dd5f 100644
--- a/term/users.c
+++ b/term/users.c
@@ -795,7 +795,10 @@ trivfs_S_io_readable (struct trivfs_protid *cred,
mutex_lock (&global_lock);
if ((cred->po->openmodes & O_READ) == 0)
- return EBADF;
+ {
+ mutex_unlock (&global_lock);
+ return EBADF;
+ }
*amt = qsize (inputq);
if (remote_input_mode && *amt)
--*amt;