diff --git a/fs/vfs/fs_truncate.c b/fs/vfs/fs_truncate.c index 91bbd8e5a0..2f11c17ec9 100644 --- a/fs/vfs/fs_truncate.c +++ b/fs/vfs/fs_truncate.c @@ -57,7 +57,7 @@ int file_truncate(FAR struct file *filep, off_t length) if ((filep->f_oflags & O_WROK) == 0) { fwarn("WARNING: Cannot truncate a file opened read-only\n"); - return -EBADF; + return -EINVAL; } /* Is this inode a registered mountpoint? Does it support the