1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

systemd: Fix build with latest musl

musl has removed basename from string.h [1] which leads to build
failures now as declaration is gone and it should be coming from
libgen.h

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

(From OE-Core rev: 868542315f8c914f96ee55713f7a3e0d0154c3ae)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2023-12-13 12:40:53 -08:00
committed by Richard Purdie
parent 26560efaea
commit 5800c6a60f
@@ -13,22 +13,16 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
src/machine/machine-dbus.c | 5 +++++ src/machine/machine-dbus.c | 5 +++++
1 file changed, 5 insertions(+) 1 file changed, 5 insertions(+)
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c --- a/src/basic/string-util.h
index 45bc056326..aee51d5da5 100644 +++ b/src/basic/string-util.h
--- a/src/machine/machine-dbus.c @@ -26,6 +26,10 @@
+++ b/src/machine/machine-dbus.c #define URI_UNRESERVED ALPHANUMERICAL "-._~" /* [RFC3986] */
@@ -4,6 +4,11 @@ #define URI_VALID URI_RESERVED URI_UNRESERVED /* [RFC3986] */
#include <sys/mount.h>
#include <sys/wait.h>
+#if !defined(__GLIBC__) +#if !defined(__GLIBC__)
+#include <string.h>
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) +#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif +#endif
+ +
#include "alloc-util.h" static inline char* strstr_ptr(const char *haystack, const char *needle) {
#include "bus-common-errors.h" if (!haystack || !needle)
#include "bus-get-properties.h" return NULL;
--
2.39.2