summaryrefslogtreecommitdiff
path: root/trans/streamio.c
diff options
context:
space:
mode:
Diffstat (limited to 'trans/streamio.c')
-rw-r--r--trans/streamio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/trans/streamio.c b/trans/streamio.c
index 8ff3dc63..68badd21 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -625,6 +625,8 @@ trivfs_S_file_set_size (struct trivfs_protid *cred,
return EOPNOTSUPP;
else if (!(cred->po->openmodes & O_WRITE))
return EBADF;
+ else if (size < 0)
+ return EINVAL;
else
return 0;
}