check: Fix uninitialized variable compiler warning with gcc
authorSebastian Dröge <sebastian@centricular.com>
Sat, 21 Mar 2015 18:37:30 +0000 (19:37 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 21 Mar 2015 18:37:30 +0000 (19:37 +0100)
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);
                               ^

libs/gst/check/libcheck/check_run.c

index c8a6817..38d2cf6 100644 (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;
       }