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.
This commit is contained in:
Andreas Kling 2021-02-09 16:22:38 +01:00
parent 1f277f0bd9
commit 085f80aeac

View file

@ -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 {};