Adding d/p/34_check_curl_fix_compare_warning from upstream

This commit is contained in:
Jan Wagner 2023-03-27 14:02:54 +00:00
parent 6f89be8380
commit 983507a144
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,31 @@
From cf90f0de7b3c347a6860b50de6a610bd7132668c Mon Sep 17 00:00:00 2001
From: Andreas Baumann <mail@andreasbaumann.cc>
Date: Thu, 16 Mar 2023 16:21:46 +0100
Subject: [PATCH] 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 e5be1ad56..c51914a9a 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -55,6 +55,7 @@ const char *email = "devel@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
);

View file

@ -12,3 +12,4 @@
31_checl_mailq_separate_submission_queue 31_checl_mailq_separate_submission_queue
32_check_disk_add_ignore_missing 32_check_disk_add_ignore_missing
33_check_procs_exclude-process 33_check_procs_exclude-process
34_check_curl_fix_compare_warning