summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-30 15:37:51 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-30 15:37:51 +0200
commit8fe72d7b3cfadb66bda77d295fbe178667190444 (patch)
tree373062c3047c94517580614877e17363032c3210 /Kernel/Process.cpp
parent7710863e3cfe3d0404780fc22a2e54655aeb4c54 (diff)
downloadserenity-8fe72d7b3cfadb66bda77d295fbe178667190444.zip
Kernel: Make fcntl(F_SETFL) actually update the append/blocking flags.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp8
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;
}