blob: 89736bcfdedf92948dbaa48aec0a8d5d6ec7905a [file] [log] [blame]
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001From dd134880e9a16595ab473934577e873c748e9c7a Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700
Andrew Geisslerd1e89492021-02-12 15:35:20 -06004Subject: [PATCH 13/26] Define glibc compatible basename() for non-glibc
5 systems
Brad Bishop19323692019-04-05 15:28:33 -04006
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---
Andrew Geissler82c905d2020-04-13 13:39:40 -050014 src/machine/machine-dbus.c | 5 +++++
15 1 file changed, 5 insertions(+)
Brad Bishop19323692019-04-05 15:28:33 -040016
Andrew Geisslerd1e89492021-02-12 15:35:20 -060017diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
18index f5780f1aec..aec5825b3e 100644
19--- a/src/machine/machine-dbus.c
20+++ b/src/machine/machine-dbus.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050021@@ -11,6 +11,11 @@
Brad Bishop19323692019-04-05 15:28:33 -040022 #include <libgen.h>
23 #undef basename
24
25+#if !defined(__GLIBC__)
Andrew Geissler82c905d2020-04-13 13:39:40 -050026+#include <string.h>
Brad Bishop19323692019-04-05 15:28:33 -040027+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
28+#endif
29+
30 #include "alloc-util.h"
31 #include "bus-common-errors.h"
Andrew Geissler635e0e42020-08-21 15:58:33 -050032 #include "bus-get-properties.h"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060033--
342.27.0
35