4
0
Эх сурвалжийг харах

check_dig: Declare variable at the top

C89 doesn't allow variable declarations to be intermingled with code.
Holger Weiss 12 жил өмнө
parent
commit
897f627e07

+ 2 - 1
plugins/check_dig.c

@@ -74,6 +74,7 @@ main (int argc, char **argv)
   long microsec;
   long microsec;
   double elapsed_time;
   double elapsed_time;
   int result = STATE_UNKNOWN;
   int result = STATE_UNKNOWN;
+  int timeout_interval_dig;
 
 
   setlocale (LC_ALL, "");
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   bindtextdomain (PACKAGE, LOCALEDIR);
@@ -90,7 +91,7 @@ main (int argc, char **argv)
     usage_va(_("Could not parse arguments"));
     usage_va(_("Could not parse arguments"));
 
 
   /* dig applies the timeout to each try, so we need to work around this */
   /* dig applies the timeout to each try, so we need to work around this */
-  int timeout_interval_dig = ceil((double) timeout_interval / (double) number_tries);
+  timeout_interval_dig = ceil((double) timeout_interval / (double) number_tries);
 
 
   /* get the command to run */
   /* get the command to run */
   xasprintf (&command_line, "%s @%s -p %d %s -t %s %s %s +tries=%d +time=%d",
   xasprintf (&command_line, "%s @%s -p %d %s -t %s %s %s +tries=%d +time=%d",