summaryrefslogtreecommitdiff
path: root/Kernel/ThreadBlockers.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-20 23:11:17 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-20 23:20:02 +0100
commit19d3f8cab77a95b284e30f142521c6b483221324 (patch)
tree8df3f585e91113215b52d10a9a0032c9998dc1b5 /Kernel/ThreadBlockers.cpp
parente279b45aed5509efc537fc8c831f40733d7b1028 (diff)
downloadserenity-19d3f8cab77a95b284e30f142521c6b483221324.zip
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
Diffstat (limited to 'Kernel/ThreadBlockers.cpp')
-rw-r--r--Kernel/ThreadBlockers.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/ThreadBlockers.cpp b/Kernel/ThreadBlockers.cpp
index 7e3d023b34..d1e8b2cbb5 100644
--- a/Kernel/ThreadBlockers.cpp
+++ b/Kernel/ThreadBlockers.cpp
@@ -611,7 +611,7 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, idtype_t id_type, pid_t id, K
case P_PID: {
m_waitee = Process::from_pid(m_waitee_id);
if (!m_waitee || m_waitee->ppid() != Process::current()->pid()) {
- m_result = KResult(-ECHILD);
+ m_result = ECHILD;
m_error = true;
return;
}
@@ -620,7 +620,7 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, idtype_t id_type, pid_t id, K
case P_PGID: {
m_waitee_group = ProcessGroup::from_pgid(m_waitee_id);
if (!m_waitee_group) {
- m_result = KResult(-ECHILD);
+ m_result = ECHILD;
m_error = true;
return;
}
@@ -670,7 +670,7 @@ void Thread::WaitBlocker::do_was_disowned()
{
ASSERT(!m_did_unblock);
m_did_unblock = true;
- m_result = KResult(-ECHILD);
+ m_result = ECHILD;
}
void Thread::WaitBlocker::do_set_result(const siginfo_t& result)