check: Fix uninitialized variable compiler warning with gcc

check_run.c: In function 'sig_handler':
check_run.c:127:13: warning: 'child_sig' may be used uninitialized in this function [-Wmaybe-uninitialized]
             killpg(group_pid, child_sig);
             ^
check_run.c:130:31: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
             sigaction(sig_nr, &old_action[idx], NULL);
                               ^
This commit is contained in:
Sebastian Dröge 2015-03-21 19:37:30 +01:00
parent 7646cef644
commit 805684585e

View file

@ -116,7 +116,8 @@ sig_handler (int sig_nr)
if (sig_nr == SIGINT) {
idx = 1;
child_sig = SIGKILL;
} else if (sig_nr == SIGTERM) {
} else { /* if (sig_nr == SIGTERM) */
idx = 2;
child_sig = SIGTERM;
}