All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/zabbix: fix libcurl build
@ 2023-02-20  9:33 Fabrice Fontaine
  2023-02-20 20:44 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2023-02-20  9:33 UTC (permalink / raw)
  To: buildroot; +Cc: Alexey Lukyanchuk, Fabrice Fontaine

Fix the following libcurl build failure:

In file included from /tmp/instance-1/output-1/host/s390x-buildroot-linux-gnu/sysroot/usr/include/curl/curl.h:3195,
                 from ../../../../include/sysinc.h:384,
                 from ../../../../include/common.h:23,
                 from simple.c:20:
simple.c: In function 'check_https':
simple.c:167:65: error: invalid use of void expression
  167 |         if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_USERAGENT, "Zabbix " ZABBIX_VERSION)) ||
      |                                                                 ^

Fixes:
 - http://autobuild.buildroot.org/results/053a62e9969046a7f8a0e1890c24d2bfb099ae42

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...se-parentheses-to-ensure-compilation.patch | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 package/zabbix/0002-Use-parentheses-to-ensure-compilation.patch

diff --git a/package/zabbix/0002-Use-parentheses-to-ensure-compilation.patch b/package/zabbix/0002-Use-parentheses-to-ensure-compilation.patch
new file mode 100644
index 0000000000..482480e5e0
--- /dev/null
+++ b/package/zabbix/0002-Use-parentheses-to-ensure-compilation.patch
@@ -0,0 +1,65 @@
+From 2fe3c652bd6a6522d5be3fd41c6ed39ddc2d21fa Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 13 Feb 2023 14:32:38 +0100
+Subject: [PATCH] Use parentheses to ensure compilation
+
+Compiler fails with latest Curl release. Use parenthesis to ensure
+compiler evaluates expression correctly:
+
+In file included from /tmp/instance-1/output-1/host/s390x-buildroot-linux-gnu/sysroot/usr/include/curl/curl.h:3195,
+                 from ../../../../include/sysinc.h:384,
+                 from ../../../../include/common.h:23,
+                 from simple.c:20:
+simple.c: In function 'check_https':
+simple.c:167:65: error: invalid use of void expression
+  167 |         if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_USERAGENT, "Zabbix " ZABBIX_VERSION)) ||
+      |                                                                 ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/053a62e9969046a7f8a0e1890c24d2bfb099ae42
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not sent (no feedback on first patch)]
+---
+ src/libs/zbxsysinfo/simple/simple.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/libs/zbxsysinfo/simple/simple.c b/src/libs/zbxsysinfo/simple/simple.c
+index fc16a784cf..c3ce974492 100644
+--- a/src/libs/zbxsysinfo/simple/simple.c
++++ b/src/libs/zbxsysinfo/simple/simple.c
+@@ -177,14 +177,14 @@ static int	check_https(const char *host, unsigned short port, int timeout, int *
+ 	else
+ 		zbx_snprintf(https_host, sizeof(https_host), "%s%s", (0 == strncmp(host, "https://", 8) ? "" : "https://"), host);
+ 
+-	if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_USERAGENT, "Zabbix " ZABBIX_VERSION)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_URL, https_host)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_PORT, (long)port)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_NOBODY, 1L)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSL_VERIFYPEER, 0L)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSL_VERIFYHOST, 0L)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_TIMEOUT, (long)timeout)) ||
+-		CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = ZBX_CURLOPT_ACCEPT_ENCODING, "")))
++	if (CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_USERAGENT), "Zabbix " ZABBIX_VERSION)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_URL), https_host)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_PORT), (long)port)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_NOBODY), 1L)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_SSL_VERIFYPEER), 0L)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_SSL_VERIFYHOST), 0L)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_TIMEOUT), (long)timeout)) ||
++		CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = ZBX_CURLOPT_ACCEPT_ENCODING), "")))
+ 	{
+ 		zabbix_log(LOG_LEVEL_DEBUG, "%s: could not set cURL option [%d]: %s",
+ 				__func__, (int)opt, curl_easy_strerror(err));
+@@ -193,7 +193,7 @@ static int	check_https(const char *host, unsigned short port, int timeout, int *
+ 
+ 	if (NULL != CONFIG_SOURCE_IP)
+ 	{
+-		if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_INTERFACE, CONFIG_SOURCE_IP)))
++		if (CURLE_OK != (err = curl_easy_setopt(easyhandle, (opt = CURLOPT_INTERFACE), CONFIG_SOURCE_IP)))
+ 		{
+ 			zabbix_log(LOG_LEVEL_DEBUG, "%s: could not set source interface option [%d]: %s",
+ 					__func__, (int)opt, curl_easy_strerror(err));
+-- 
+2.39.0
+
-- 
2.39.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-24 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20  9:33 [Buildroot] [PATCH 1/1] package/zabbix: fix libcurl build Fabrice Fontaine
2023-02-20 20:44 ` Thomas Petazzoni via buildroot
2023-02-24 11:21   ` Fabrice Fontaine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.