summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-09 16:22:38 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-09 19:18:13 +0100
commit085f80aeac0a93114006e5dec4c4a021eb6ae716 (patch)
treeb551c174f357c042f4fa34a613dd68f61a9f0574
parent1f277f0bd9d6b74b3a521bd1dc280372b661d81d (diff)
downloadserenity-085f80aeac0a93114006e5dec4c4a021eb6ae716.zip
Kernel: Remove unused root directory computation in Process creation
sys$fork() already takes care of children inheriting the parent's root directory, so there was no need to do the same thing when creating a new user process.
-rw-r--r--Kernel/Process.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 6ed5a8831c..aaf5922cc7 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -156,21 +156,16 @@ RefPtr<Process> Process::create_user_process(RefPtr<Thread>& first_thread, const
arguments.append(parts.last());
}
RefPtr<Custody> cwd;
- RefPtr<Custody> root;
{
ScopedSpinLock lock(g_processes_lock);
if (auto parent = Process::from_pid(parent_pid)) {
cwd = parent->m_cwd;
- root = parent->m_root_directory;
}
}
if (!cwd)
cwd = VFS::the().root_custody();
- if (!root)
- root = VFS::the().root_custody();
-
auto process = adopt(*new Process(first_thread, parts.take_last(), uid, gid, parent_pid, false, move(cwd), nullptr, tty));
if (!first_thread)
return {};