mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +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:
parent
05653a9189
commit
15f3abc849
2 changed files with 3 additions and 4 deletions
|
@ -205,6 +205,9 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
|||
auto& inode = custody.inode();
|
||||
auto metadata = inode.metadata();
|
||||
|
||||
if ((options & O_DIRECTORY) && !metadata.is_directory())
|
||||
return KResult(-ENOTDIR);
|
||||
|
||||
bool should_truncate_file = false;
|
||||
|
||||
// NOTE: Read permission is a bit weird, since O_RDONLY == 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue