zabbix: zabbix_helper_mac80211.c: use POSIX <libgen.h> header 23599/head
authorTony Ambardar <itugrok@yahoo.com>
Wed, 6 Mar 2024 09:18:34 +0000 (01:18 -0800)
committerTony Ambardar <itugrok@yahoo.com>
Wed, 6 Mar 2024 13:44:46 +0000 (05:44 -0800)
The musl libc only implements POSIX basename() but provided a GNU header
kludge in <string.h>, which was removed in musl 1.2.5 [1]. Use the standard
<libgen.h> header to avoid compilation warnings like:

zabbix-6.4.7/zabbix-extra-mac80211/zabbix_helper_mac80211.c:37:11: warning:
 implicit declaration of function 'basename' [-Wimplicit-function-declaration]
   37 |     phy = basename(phy);
      |           ^~~~~~~~
zabbix-6.4.7/zabbix-extra-mac80211/zabbix_helper_mac80211.c:37:9: warning:
 assignment to 'char *' from 'int' makes pointer from integer without a cast
 [-Wint-conversion]
   37 |     phy = basename(phy);
      |         ^
zabbix-6.4.7/zabbix-extra-mac80211/zabbix_helper_mac80211.c:38:10: warning:
 assignment to 'char *' from 'int' makes pointer from integer without a cast
 [-Wint-conversion]
   38 |     stat = basename(stat);
      |          ^

Link 1: https://git.musl-libc.org/cgit/musl/log/?qt=grep&q=basename

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
admin/zabbix/Makefile
admin/zabbix/files/zabbix_helper_mac80211.c

index c4f8c464ac6ab99e3d8ace490c12fd24e7eb9d74..b395b6134c9abf67b3b6d63cca84269653b66815 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zabbix
 PKG_VERSION:=6.4.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/$(basename $(PKG_VERSION))/ \
index 1442d2743204c41f8624b11c8b0235502b1ae16f..e03c46c3df25335892a3227ffaad707ce3af576f 100644 (file)
@@ -1,6 +1,7 @@
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <string.h>
+#include <libgen.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <dirent.h>