1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:08:12 +00:00

Kernel: Move Process's TTY pointer into protected data

This commit is contained in:
Andreas Kling 2023-04-04 08:15:44 +02:00
parent 1e2ef59965
commit e69b2572a6
3 changed files with 8 additions and 9 deletions

View file

@ -38,8 +38,8 @@ ErrorOr<FlatPtr> Process::sys$setsid()
// Create a new Session and a new ProcessGroup.
auto process_group = TRY(ProcessGroup::create(ProcessGroupID(pid().value())));
m_tty.with([](auto& tty) { tty = nullptr; });
return with_mutable_protected_data([&](auto& protected_data) -> ErrorOr<FlatPtr> {
protected_data.tty = nullptr;
protected_data.process_group = move(process_group);
protected_data.sid = pid().value();
return protected_data.sid.value();