Просмотр исходного кода

check_fping.c: add parentheses for silencing this warning

See,
check_fping.c:150:14: warning: using the result of an assignment as a condition
      without parentheses [-Wparentheses]
  if (result = spclose (child_process))
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
check_fping.c:150:14: note: place parentheses around the assignment to silence
      this warning
  if (result = spclose (child_process))
             ^
      (                               )
check_fping.c:150:14: note: use '==' to turn this assignment into an equality
      comparison
  if (result = spclose (child_process))
             ^
             ==
1 warning generated.
Mario Trangoni 7 лет назад
Родитель
Сommit
dee5e0c061
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins/check_fping.c

+ 1 - 1
plugins/check_fping.c

@@ -147,7 +147,7 @@ main (int argc, char **argv)
   (void) fclose (child_stderr);
 
   /* close the pipe */
-  if (result = spclose (child_process))
+  if ((result = spclose (child_process)))
     /* need to use max_state not max */
     status = max_state (status, STATE_WARNING);