mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user