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

Added ceil back to check_dig timeout
This requires mathlibs, so that was added to the makefile.
Removed a duplicate help output for timeout as well.

abrist 12 лет назад
Родитель
Сommit
1bc3f6afee
2 измененных файлов с 2 добавлено и 7 удалено
  1. 1 1
      plugins/Makefile.am
  2. 1 6
      plugins/check_dig.c

+ 1 - 1
plugins/Makefile.am

@@ -69,7 +69,7 @@ test-debug:
 check_apt_LDADD = $(BASEOBJS)
 check_cluster_LDADD = $(BASEOBJS)
 check_dbi_LDADD = $(NETLIBS) $(DBILIBS)
-check_dig_LDADD = $(NETLIBS)
+check_dig_LDADD = $(NETLIBS) $(MATHLIBS)
 check_disk_LDADD = $(BASEOBJS)
 check_dns_LDADD = $(NETLIBS)
 check_dummy_LDADD = $(BASEOBJS)

+ 1 - 6
plugins/check_dig.c

@@ -92,10 +92,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;
-
-  if (timeout_interval_dig < 1)
-    usage_va(_("Division of timeout value by retries value cannot be less than one"));
+  int timeout_interval_dig = ceil((double) timeout_interval / (double) number_tries);
 
   /* get the command to run */
   xasprintf (&command_line, "%s @%s -p %d %s -t %s %s %s +tries=%d +time=%d",
@@ -366,8 +363,6 @@ print_help (void)
   printf ("    %s\n",_("was in -l"));
   printf (" %s\n","-A, --dig-arguments=STRING");
   printf ("    %s\n",_("Pass STRING as argument(s) to dig"));
-  printf (" %s\n","-t, --timeout=INTEGER");
-  printf ("    %s\n",_("Timeout value (seconds) passed to dig (Default: 15)"));
   printf (" %s\n","-r, --retries=INTEGER");
   printf ("    %s\n",_("Number of retries passed to dig, timeout is divided by this value (Default: 3)"));
   printf (UT_WARN_CRIT);