[monitoring-plugins] Replace DBL_MAX with INFITY to check if value was ...

RincewindsHat git at monitoring-plugins.org
Sat Mar 4 21:10:11 CET 2023


 Module: monitoring-plugins
 Branch: master
 Commit: 9a73a94258689cd9337fe7a7937fe85e4670aaeb
 Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
   Date: Fri Nov  4 17:08:36 2022 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=9a73a94

Replace DBL_MAX with INFITY to check if value was set

---

 plugins-root/check_icmp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 0d10d22..7f3c4b5 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -55,6 +55,7 @@ const char *email = "devel at monitoring-plugins.org";
 #include <errno.h>
 #include <signal.h>
 #include <ctype.h>
+#include <float.h>
 #include <net/if.h>
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
@@ -1220,7 +1221,7 @@ finish(int sig)
 			   host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000,
 			   (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl,
 			   (targets > 1) ? host->name : "", (float)host->rtmax / 1000,
-			   (targets > 1) ? host->name : "", (host->rtmin < DBL_MAX) ? (float)host->rtmin / 1000 : (float)0);
+			   (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0);
 
 		host = host->next;
 	}
@@ -1323,7 +1324,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in)
 		memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr);
 	}
 
-	host->rtmin = DBL_MAX;
+	host->rtmin = INFINITY;
 
 	if(!list) list = cursor = host;
 	else cursor->next = host;



More information about the Commits mailing list