mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Fix sys$waitid(P_ALL, WNOHANG) return value
According to POSIX, waitid() should fill si_signo and si_pid members with zeroes if there are no children that have already changed their state by the time of the call. Let's just fill the whole structure with zeroes to avoid leaking kernel memory.
This commit is contained in:
parent
f46d80ac4f
commit
1b866bbf42
Notes:
sideshowbarker
2024-07-19 09:34:35 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/1b866bbf42a
1 changed files with 1 additions and 1 deletions
|
@ -2314,7 +2314,7 @@ 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;
|
||||
siginfo_t siginfo = { 0 };
|
||||
for_each_child([&siginfo](Process& process) {
|
||||
if (process.is_dead())
|
||||
siginfo = reap(process);
|
||||
|
|
Loading…
Reference in a new issue