mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 02:55:15 +00:00
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:
parent
1f277f0bd9
commit
085f80aeac
|
@ -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 {};
|
||||
|
|
Loading…
Reference in a new issue