mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:37:34 +00:00
Kernel: memset() all siginfo_t structs after creating them
This commit is contained in:
parent
1b866bbf42
commit
dc18859695
1 changed files with 4 additions and 1 deletions
|
@ -2269,6 +2269,7 @@ mode_t Process::sys$umask(mode_t mask)
|
||||||
siginfo_t Process::reap(Process& process)
|
siginfo_t Process::reap(Process& process)
|
||||||
{
|
{
|
||||||
siginfo_t siginfo;
|
siginfo_t siginfo;
|
||||||
|
memset(&siginfo, 0, sizeof(siginfo));
|
||||||
siginfo.si_signo = SIGCHLD;
|
siginfo.si_signo = SIGCHLD;
|
||||||
siginfo.si_pid = process.pid();
|
siginfo.si_pid = process.pid();
|
||||||
siginfo.si_uid = process.uid();
|
siginfo.si_uid = process.uid();
|
||||||
|
@ -2314,7 +2315,8 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
|
||||||
// FIXME: Figure out what WNOHANG should do with stopped children.
|
// FIXME: Figure out what WNOHANG should do with stopped children.
|
||||||
if (idtype == P_ALL) {
|
if (idtype == P_ALL) {
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
siginfo_t siginfo = { 0 };
|
siginfo_t siginfo;
|
||||||
|
memset(&siginfo, 0, sizeof(siginfo));
|
||||||
for_each_child([&siginfo](Process& process) {
|
for_each_child([&siginfo](Process& process) {
|
||||||
if (process.is_dead())
|
if (process.is_dead())
|
||||||
siginfo = reap(process);
|
siginfo = reap(process);
|
||||||
|
@ -2365,6 +2367,7 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
|
||||||
return KResult(-ECHILD);
|
return KResult(-ECHILD);
|
||||||
ASSERT(waitee_thread->state() == Thread::State::Stopped);
|
ASSERT(waitee_thread->state() == Thread::State::Stopped);
|
||||||
siginfo_t siginfo;
|
siginfo_t siginfo;
|
||||||
|
memset(&siginfo, 0, sizeof(siginfo));
|
||||||
siginfo.si_signo = SIGCHLD;
|
siginfo.si_signo = SIGCHLD;
|
||||||
siginfo.si_pid = waitee_process->pid();
|
siginfo.si_pid = waitee_process->pid();
|
||||||
siginfo.si_uid = waitee_process->uid();
|
siginfo.si_uid = waitee_process->uid();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue