[monitoring-plugins] check_dig: stick with integer devision

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


 Module: monitoring-plugins
 Branch: master
 Commit: e33ecc84c7ebdf4af3e8649a326e8a5acc9fe5b6
 Author: Jan Wagner <waja at cyconet.org>
   Date: Thu Jan 30 10:02:04 2014 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e33ecc8

check_dig: stick with integer devision

This change saves us from having to link check_dig against "libm"

---

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

diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 594aa46..8c3fe6b 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -90,7 +90,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 = ceil((double) timeout_interval / (double) number_tries);
+  int 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