summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
new file mode 100644
index 0000000000..c1a8bb19fe
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
@@ -0,0 +1,34 @@
1From bab07e779ff23d5593bb118efaaa31b60a6dce87 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700
4Subject: [PATCH 08/22] Define glibc compatible basename() for non-glibc
5 systems
6
7Fixes builds with musl, even though systemd is adamant about
8using non-posix basename implementation, we have a way out
9
10Upstream-Status: Inappropriate [musl specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/basic/string-util.h | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/src/basic/string-util.h b/src/basic/string-util.h
18index b6d8be3083..0a29036c4c 100644
19--- a/src/basic/string-util.h
20+++ b/src/basic/string-util.h
21@@ -26,6 +26,10 @@
22 #define URI_UNRESERVED ALPHANUMERICAL "-._~" /* [RFC3986] */
23 #define URI_VALID URI_RESERVED URI_UNRESERVED /* [RFC3986] */
24
25+#if !defined(__GLIBC__)
26+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
27+#endif
28+
29 static inline char* strstr_ptr(const char *haystack, const char *needle) {
30 if (!haystack || !needle)
31 return NULL;
32--
332.34.1
34