Kernel: Put Process's current directory in a SpinlockProtected

Also let's call it "current_directory" instead of "cwd" everywhere.
This commit is contained in:
Andreas Kling 2022-03-07 17:56:25 +01:00
parent 71792e4b3f
commit 24f02bd421
Notes: sideshowbarker 2024-07-17 17:49:25 +09:00
5 changed files with 25 additions and 19 deletions

View file

@ -19,7 +19,7 @@ ErrorOr<FlatPtr> Process::sys$fork(RegisterState& regs)
TRY(require_promise(Pledge::proc));
RefPtr<Thread> child_first_thread;
auto child_name = TRY(m_name->try_clone());
auto child = TRY(Process::try_create(child_first_thread, move(child_name), uid(), gid(), pid(), m_is_kernel_process, m_cwd, m_executable, m_tty, this));
auto child = TRY(Process::try_create(child_first_thread, move(child_name), uid(), gid(), pid(), m_is_kernel_process, current_directory(), m_executable, m_tty, this));
child->m_veil_state = m_veil_state;
child->m_unveiled_paths = TRY(m_unveiled_paths.deep_copy());