Skip to content

Commit

Permalink
Merge branch 'fix/nullfs-open' into 'master'
Browse files Browse the repository at this point in the history
fix(vfs): fix nullfs open syscall

See merge request espressif/esp-idf!32725
  • Loading branch information
Lapshin committed Aug 12, 2024
2 parents c3b58b9 + 561587c commit 1ddd2f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/vfs/nullfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ static int vfs_null_open(const char* path, int flags, int mode)
return -1;
}

if (flags & O_RDWR) {
int acc_mode = flags & O_ACCMODE;
if (acc_mode == O_RDWR) {
SET_READABLE(g_fds, fd);
SET_WRITABLE(g_fds, fd);
} else if (flags & O_WRONLY) {
} else if (acc_mode == O_WRONLY) {
SET_WRITABLE(g_fds, fd);
} else if (flags & O_RDONLY) {
} else if (acc_mode == O_RDONLY) {
SET_READABLE(g_fds, fd);
} else {
errno = EINVAL;
Expand Down

0 comments on commit 1ddd2f4

Please sign in to comment.