1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:35:07 +00:00

Shell: Make Job constructors private and use a create() helper

Also store PGIDs as pid_t since that's what they are.
This commit is contained in:
Andreas Kling 2020-08-06 13:48:45 +02:00
parent bf2cd9374c
commit 5bce0193de
2 changed files with 14 additions and 16 deletions

View file

@ -572,7 +572,7 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
StringBuilder cmd;
cmd.join(" ", command.argv);
auto job = adopt(*new Job(child, (unsigned)child, cmd.build(), find_last_job_id() + 1));
auto job = Job::create(child, (unsigned)child, cmd.build(), find_last_job_id() + 1);
jobs.set((u64)child, job);
job->on_exit = [](auto job) {