Revert "Kernel: Make VFS::create() fail with EINVAL on invalid file mode"

This reverts commit ca3489eec7.

Fixes #5087.
This commit is contained in:
Andreas Kling 2021-01-24 08:31:18 +01:00
parent 50a2cb38e5
commit 2112b79986

View file

@ -389,8 +389,10 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::create(StringView path, int optio
if (result.is_error())
return result;
if (!is_regular_file(mode) && !is_socket(mode) && !is_fifo(mode) && !is_block_device(mode) && !is_character_device(mode))
return EINVAL;
if (!is_socket(mode) && !is_fifo(mode) && !is_block_device(mode) && !is_character_device(mode)) {
// Turn it into a regular file. (This feels rather hackish.)
mode |= 0100000;
}
auto& parent_inode = parent_custody.inode();
auto current_process = Process::current();