Signed-off-by: Khem Raj <[email protected]>
---
 ....c-Include-libgen.h-for-basename-API.patch | 55 +++++++++++++++++++
 .../connman/connman_1.42.bb                   |  1 +
 2 files changed, 56 insertions(+)
 create mode 100644 
meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch

diff --git 
a/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch
 
b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch
new file mode 100644
index 00000000000..8012606db7f
--- /dev/null
+++ 
b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch
@@ -0,0 +1,55 @@
+From cbba6638986c2de763981bf6fc59df6a86fed44f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 1 Jan 2024 17:42:21 -0800
+Subject: [PATCH v2] src/log.c: Include libgen.h for basename API
+
+Use POSIX version of basename. This comes to front with latest musl
+which dropped the declaration from string.h [1] it fails to build with
+clang-17+ because it treats implicit function declaration as error.
+
+Fix it by applying the basename on a copy of string since posix version
+may modify the input string.
+
+[1] 
https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Upstream-Status: Submitted 
[https://lore.kernel.org/connman/[email protected]/T/#u]
+Signed-off-by: Khem Raj <[email protected]>
+---
+
+ src/log.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/log.c b/src/log.c
+index 554b046..2df3af7 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -24,6 +24,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <libgen.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+@@ -196,6 +197,7 @@ int __connman_log_init(const char *program, const char 
*debug,
+               const char *program_name, const char *program_version)
+ {
+       static char path[PATH_MAX];
++      char* tmp = strdup(program);
+       int option = LOG_NDELAY | LOG_PID;
+ 
+       program_exec = program;
+@@ -212,8 +214,8 @@ int __connman_log_init(const char *program, const char 
*debug,
+       if (backtrace)
+               signal_setup(signal_handler);
+ 
+-      openlog(basename(program), option, LOG_DAEMON);
+-
++      openlog(basename(tmp), option, LOG_DAEMON);
++      free(tmp);
+       syslog(LOG_INFO, "%s version %s", program_name, program_version);
+ 
+       return 0;
+-- 
+2.43.0
+
diff --git a/meta/recipes-connectivity/connman/connman_1.42.bb 
b/meta/recipes-connectivity/connman/connman_1.42.bb
index c2fcd617aea..91ab9895ac8 100644
--- a/meta/recipes-connectivity/connman/connman_1.42.bb
+++ b/meta/recipes-connectivity/connman/connman_1.42.bb
@@ -6,6 +6,7 @@ SRC_URI = 
"${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
            file://connman \
            file://no-version-scripts.patch \
            file://0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch \
+           file://0001-src-log.c-Include-libgen.h-for-basename-API.patch \
            "
 
 SRC_URI:append:libc-musl = " 
file://0002-resolve-musl-does-not-implement-res_ninit.patch"
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193218): 
https://lists.openembedded.org/g/openembedded-core/message/193218
Mute This Topic: https://lists.openembedded.org/mt/103478224/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to