mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +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
1 changed files with 0 additions and 5 deletions
|
@ -156,21 +156,16 @@ RefPtr<Process> Process::create_user_process(RefPtr<Thread>& first_thread, const
|
||||||
arguments.append(parts.last());
|
arguments.append(parts.last());
|
||||||
}
|
}
|
||||||
RefPtr<Custody> cwd;
|
RefPtr<Custody> cwd;
|
||||||
RefPtr<Custody> root;
|
|
||||||
{
|
{
|
||||||
ScopedSpinLock lock(g_processes_lock);
|
ScopedSpinLock lock(g_processes_lock);
|
||||||
if (auto parent = Process::from_pid(parent_pid)) {
|
if (auto parent = Process::from_pid(parent_pid)) {
|
||||||
cwd = parent->m_cwd;
|
cwd = parent->m_cwd;
|
||||||
root = parent->m_root_directory;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cwd)
|
if (!cwd)
|
||||||
cwd = VFS::the().root_custody();
|
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));
|
auto process = adopt(*new Process(first_thread, parts.take_last(), uid, gid, parent_pid, false, move(cwd), nullptr, tty));
|
||||||
if (!first_thread)
|
if (!first_thread)
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue