mirror of
https://github.com/Icinga/icinga2.git
synced 2026-05-28 04:12:13 -04:00
Silence -Wmaybe-uninitialized on older compilers
This is currently a false positive on the debian:11 target and my assumption is that the older GCC can't prove that when `ProcessWaitPID()` returns early, `WIFSIGNALED(status)` is never used. However leaving the variables uninitialized like that is bad anyway, since this might easily be missed when slightly refactoring the function or if/else blocks and then lead to undefined behavior. So now they just get initialized to zero.
This commit is contained in:
parent
037fe1b9b2
commit
30fc4e2160
1 changed files with 2 additions and 1 deletions
|
|
@ -1122,7 +1122,8 @@ bool Process::DoEvents()
|
|||
Log(LogNotice, "Process")
|
||||
<< "PID " << m_PID << " (" << PrettyPrintArguments(m_Arguments) << ") terminated with exit code " << exitcode;
|
||||
#else /* _WIN32 */
|
||||
int status, exitcode;
|
||||
int status = 0;
|
||||
int exitcode = 0;
|
||||
if (could_not_kill || m_PID == -1) {
|
||||
exitcode = 128;
|
||||
} else if (ProcessWaitPID(m_Process, &status) != m_Process) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue