diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-13 01:36:31 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-13 01:36:31 +0100 |
commit | 97c799576a478d3881bfff1196f0fa829d736994 (patch) | |
tree | fb9d43820e7e65318c2f0e3d9f67932aee3a78ae /Kernel/Scheduler.cpp | |
parent | 19b9401487e87dcbb43b52c6fe194e3b0e49f842 (diff) | |
download | serenity-97c799576a478d3881bfff1196f0fa829d736994.zip |
Add close-on-exec flag for file descriptors.
I was surprised to find that dup()'ed fds don't share the close-on-exec flag.
That means it has to be stored separately from the FileDescriptor object.
Diffstat (limited to 'Kernel/Scheduler.cpp')
-rw-r--r-- | Kernel/Scheduler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index a2f746abdb..15a2118c88 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -52,14 +52,14 @@ bool Scheduler::pick_next() if (process.state() == Process::BlockedRead) { ASSERT(process.m_fdBlockedOnRead != -1); // FIXME: Block until the amount of data wanted is available. - if (process.m_file_descriptors[process.m_fdBlockedOnRead]->hasDataAvailableForRead()) + if (process.m_fds[process.m_fdBlockedOnRead].descriptor->hasDataAvailableForRead()) process.unblock(); return true; } if (process.state() == Process::BlockedWrite) { ASSERT(process.m_blocked_fd != -1); - if (process.m_file_descriptors[process.m_blocked_fd]->can_write()) + if (process.m_fds[process.m_blocked_fd].descriptor->can_write()) process.unblock(); return true; } |