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:
parent
7fb6a92e35
commit
cb54c838a0
@ -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? */
|
||||
|
Loading…
Reference in New Issue
Block a user