[monitoring-plugins] check_dig: Declare variable at the top

Git Repository git at monitoring-plugins.org
Thu Jan 30 20:10:07 CET 2014


 Module: monitoring-plugins
 Branch: master
 Commit: 4a2a7254653476c8baae583101bc50451de9431b
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Thu Jan 30 19:51:46 2014 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=4a2a725

check_dig: Declare variable at the top

C89 doesn't allow variable declarations to be intermingled with code.

---

 plugins/check_dig.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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



More information about the Commits mailing list