mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
Kernel: Use uniform initialization instead of memset for a few stack buffer.
Raw memset is relatively easy to mess up, avoid it when there are better alternatives provided by the compiler in modern C++.
This commit is contained in:
parent
7c950c2d01
commit
cbd8f78cce
Notes:
sideshowbarker
2024-07-18 22:03:48 +09:00
Author: https://github.com/bgianfo
Commit: cbd8f78cce
Pull-request: https://github.com/SerenityOS/serenity/pull/5449
Reviewed-by: https://github.com/awesomekling
3 changed files with 5 additions and 9 deletions
|
@ -739,11 +739,10 @@ bool Thread::WaitBlocker::unblock(Process& process, UnblockFlags flags, u8 signa
|
|||
// more than once!
|
||||
do_set_result(process.wait_info());
|
||||
} else {
|
||||
siginfo_t siginfo;
|
||||
memset(&siginfo, 0, sizeof(siginfo));
|
||||
siginfo_t siginfo {};
|
||||
{
|
||||
ScopedSpinLock lock(g_scheduler_lock);
|
||||
// We need to gather the information before we release the sheduler lock!
|
||||
// We need to gather the information before we release the scheduler lock!
|
||||
siginfo.si_signo = SIGCHLD;
|
||||
siginfo.si_pid = process.pid().value();
|
||||
siginfo.si_uid = process.uid();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue