1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-01 03:22:12 +00:00

Rage hacking to get bash to run. It finally runs. So cool! :^)

This commit is contained in:
Andreas Kling 2018-11-11 15:36:40 +01:00
parent 9b70808ab5
commit d5d45d1088
31 changed files with 567 additions and 61 deletions

View file

@ -35,15 +35,17 @@ bool Scheduler::pick_next()
}
if (process.state() == Process::BlockedWait) {
auto* waitee = Process::from_pid(process.waitee());
if (!waitee) {
kprintf("waitee %u of %s(%u) reaped before I could wait?\n", process.waitee(), process.name().characters(), process.pid());
ASSERT_NOT_REACHED();
}
if (waitee->state() == Process::Dead) {
process.m_waitee_status = (waitee->m_termination_status << 8) | waitee->m_termination_signal;
process.unblock();
}
process.for_each_child([&process] (Process& child) {
if (child.state() != Process::Dead)
return true;
if (process.waitee() == -1 || process.waitee() == child.pid()) {
process.m_waitee_status = (child.m_termination_status << 8) | child.m_termination_signal;
process.m_waitee = child.pid();
process.unblock();
return false;
}
return true;
});
return true;
}