From 085f80aeac0a93114006e5dec4c4a021eb6ae716 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 9 Feb 2021 16:22:38 +0100 Subject: [PATCH] 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. --- Kernel/Process.cpp | 5 ----- 1 file changed, 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::create_user_process(RefPtr& first_thread, const arguments.append(parts.last()); } RefPtr cwd; - RefPtr 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 {};