vfs: adjust the error code of write to be consistent with read

According to POSIX, the EACCES will be set when file can not be
written access. Just like fs_read
This commit is contained in:
wangshuo 2021-04-09 09:29:05 +08:00 committed by Xiang Xiao
parent 7fb6a92e35
commit cb54c838a0

View File

@ -73,7 +73,7 @@ ssize_t file_write(FAR struct file *filep, FAR const void *buf,
if ((filep->f_oflags & O_WROK) == 0)
{
return -EBADF;
return -EACCES;
}
/* Is a driver registered? Does it support the write method? */