[monitoring-plugins] check_curk: including netinet/in.h (for FreeBSD), ...

Andreas Baumann git at monitoring-plugins.org
Thu Mar 16 16:30:12 CET 2023


 Module: monitoring-plugins
 Branch: curlfreebsdfixes
 Commit: cf90f0de7b3c347a6860b50de6a610bd7132668c
 Author: Andreas Baumann <mail at andreasbaumann.cc>
   Date: Thu Mar 16 16:21:46 2023 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=cf90f0d

check_curk: including netinet/in.h (for FreeBSD), fixed an ambigous compare warning

---

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

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index e5be1ad..c51914a 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -55,6 +55,7 @@ const char *email = "devel at monitoring-plugins.org";
 #include "uriparser/Uri.h"
 
 #include <arpa/inet.h>
+#include <netinet/in.h>
 
 #if defined(HAVE_SSL) && defined(USE_OPENSSL)
 #include <openssl/opensslv.h>
@@ -541,7 +542,7 @@ check_http (void)
   /* compose URL: use the address we want to connect to, set Host: header later */
   snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s",
       use_ssl ? "https" : "http",
-      use_ssl & host_name != NULL ? host_name : server_address,
+      ( use_ssl & ( host_name != NULL ) ) ? host_name : server_address,
       server_port,
       server_url
   );



More information about the Commits mailing list