diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-30 15:37:51 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-30 15:37:51 +0200 |
commit | 8fe72d7b3cfadb66bda77d295fbe178667190444 (patch) | |
tree | 373062c3047c94517580614877e17363032c3210 /Kernel/Process.cpp | |
parent | 7710863e3cfe3d0404780fc22a2e54655aeb4c54 (diff) | |
download | serenity-8fe72d7b3cfadb66bda77d295fbe178667190444.zip |
Kernel: Make fcntl(F_SETFL) actually update the append/blocking flags.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 0f82792c35..99a43d9472 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1012,7 +1012,6 @@ int Process::sys$fcntl(int fd, int cmd, dword arg) case F_GETFL: return descriptor->file_flags(); case F_SETFL: - // FIXME: Support changing O_NONBLOCK descriptor->set_file_flags(arg); break; default: @@ -1125,10 +1124,9 @@ int Process::sys$open(const char* path, int options, mode_t mode) auto descriptor = result.value(); if (options & O_DIRECTORY && !descriptor->is_directory()) return -ENOTDIR; // FIXME: This should be handled by VFS::open. - descriptor->set_blocking(!(options & O_NONBLOCK)); - descriptor->set_should_append(options & O_APPEND); - dword flags = (options & O_CLOEXEC) ? FD_CLOEXEC : 0; - m_fds[fd].set(move(descriptor), flags); + descriptor->set_file_flags(options); + dword fd_flags = (options & O_CLOEXEC) ? FD_CLOEXEC : 0; + m_fds[fd].set(move(descriptor), fd_flags); return fd; } |