fix(vfs): fix nullfs open syscall

This commit is contained in:
Alexey Lapshin 2024-08-09 15:58:23 +07:00
parent f08926be0e
commit 561587c11c

View File

@ -204,12 +204,13 @@ static int vfs_null_open(const char* path, int flags, int mode)
return -1; return -1;
} }
if (flags & O_RDWR) { int acc_mode = flags & O_ACCMODE;
if (acc_mode == O_RDWR) {
SET_READABLE(g_fds, fd); SET_READABLE(g_fds, fd);
SET_WRITABLE(g_fds, fd); SET_WRITABLE(g_fds, fd);
} else if (flags & O_WRONLY) { } else if (acc_mode == O_WRONLY) {
SET_WRITABLE(g_fds, fd); SET_WRITABLE(g_fds, fd);
} else if (flags & O_RDONLY) { } else if (acc_mode == O_RDONLY) {
SET_READABLE(g_fds, fd); SET_READABLE(g_fds, fd);
} else { } else {
errno = EINVAL; errno = EINVAL;