mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: memset() all siginfo_t structs after creating them
This commit is contained in:
parent
1b866bbf42
commit
dc18859695
Notes:
sideshowbarker
2024-07-19 09:34:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dc188596956
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 siginfo;
|
||||
memset(&siginfo, 0, sizeof(siginfo));
|
||||
siginfo.si_signo = SIGCHLD;
|
||||
siginfo.si_pid = process.pid();
|
||||
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.
|
||||
if (idtype == P_ALL) {
|
||||
InterruptDisabler disabler;
|
||||
siginfo_t siginfo = { 0 };
|
||||
siginfo_t siginfo;
|
||||
memset(&siginfo, 0, sizeof(siginfo));
|
||||
for_each_child([&siginfo](Process& process) {
|
||||
if (process.is_dead())
|
||||
siginfo = reap(process);
|
||||
|
@ -2365,6 +2367,7 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
|
|||
return KResult(-ECHILD);
|
||||
ASSERT(waitee_thread->state() == Thread::State::Stopped);
|
||||
siginfo_t siginfo;
|
||||
memset(&siginfo, 0, sizeof(siginfo));
|
||||
siginfo.si_signo = SIGCHLD;
|
||||
siginfo.si_pid = waitee_process->pid();
|
||||
siginfo.si_uid = waitee_process->uid();
|
||||
|
|
Loading…
Reference in a new issue