1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

Kernel: Handle O_DIRECTORY in VFS::open() instead of in each syscall

Just taking care of some FIXMEs.
This commit is contained in:
Andreas Kling 2020-01-03 02:23:11 +01:00
parent 05653a9189
commit 15f3abc849
2 changed files with 3 additions and 4 deletions

View file

@ -1589,8 +1589,6 @@ int Process::sys$open(const Syscall::SC_open_params* params)
if (result.is_error())
return result.error();
auto description = result.value();
if (options & O_DIRECTORY && !description->is_directory())
return -ENOTDIR; // FIXME: This should be handled by VFS::open.
description->set_file_flags(options);
u32 fd_flags = (options & O_CLOEXEC) ? FD_CLOEXEC : 0;
m_fds[fd].set(move(description), fd_flags);
@ -1629,8 +1627,6 @@ int Process::sys$openat(const Syscall::SC_openat_params* params)
if (result.is_error())
return result.error();
auto description = result.value();
if (options & O_DIRECTORY && !description->is_directory())
return -ENOTDIR; // FIXME: This should be handled by VFS::open.
description->set_file_flags(options);
u32 fd_flags = (options & O_CLOEXEC) ? FD_CLOEXEC : 0;
m_fds[fd].set(move(description), fd_flags);