diff options
Diffstat (limited to 'trans')
-rw-r--r-- | trans/null.c | 2 | ||||
-rw-r--r-- | trans/streamio.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/trans/null.c b/trans/null.c index 8b3b4e0f..4828cce3 100644 --- a/trans/null.c +++ b/trans/null.c @@ -245,6 +245,8 @@ trivfs_S_file_set_size (struct trivfs_protid *cred, mach_port_t reply, mach_msg_type_name_t replytype, loff_t size) { + if (size < 0) + return EINVAL; return 0; } 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; } |