mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 02:08:11 +00:00
Kernel: The waitpid() syscall was not storing to "wstatus" in all cases
This commit is contained in:
parent
0e6ea49410
commit
cd42ccd686
1 changed files with 4 additions and 3 deletions
|
@ -1981,7 +1981,7 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
||||||
if (wstatus && !validate_write_typed(wstatus))
|
if (wstatus && !validate_write_typed(wstatus))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
int exit_status;
|
int exit_status = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
|
@ -2001,8 +2001,6 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
||||||
}
|
}
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
if (wstatus)
|
|
||||||
copy_to_user(wstatus, &exit_status, sizeof(exit_status));
|
|
||||||
return reaped_pid;
|
return reaped_pid;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(waitee > 0); // FIXME: Implement other PID specs.
|
ASSERT(waitee > 0); // FIXME: Implement other PID specs.
|
||||||
|
@ -2036,6 +2034,9 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
||||||
ASSERT(waitee_process->any_thread().state() == Thread::State::Stopped);
|
ASSERT(waitee_process->any_thread().state() == Thread::State::Stopped);
|
||||||
exit_status = 0x7f;
|
exit_status = 0x7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wstatus)
|
||||||
|
copy_to_user(wstatus, &exit_status, sizeof(exit_status));
|
||||||
return waitee_pid;
|
return waitee_pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue