blob: 7d74cfcc24501406f13aa271f141782c2da68410 [file] [log] [blame]
Patrick Williamsda295312023-12-05 16:48:56 -06001From fdc7fb940bb41020271b9db41d5608004efdbde5 Mon Sep 17 00:00:00 2001
Andrew Geissler595f6302022-01-24 19:11:47 +00002From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700
4Subject: [PATCH] Define glibc compatible basename() for non-glibc systems
5
6Fixes builds with musl, even though systemd is adamant about
7using non-posix basename implementation, we have a way out
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geissler595f6302022-01-24 19:11:47 +000012---
13 src/machine/machine-dbus.c | 5 +++++
14 1 file changed, 5 insertions(+)
15
Patrick Williamsda295312023-12-05 16:48:56 -060016diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
17index 45bc056326..aee51d5da5 100644
Andrew Geissler595f6302022-01-24 19:11:47 +000018--- a/src/machine/machine-dbus.c
19+++ b/src/machine/machine-dbus.c
Patrick Williamsda295312023-12-05 16:48:56 -060020@@ -4,6 +4,11 @@
21 #include <sys/mount.h>
22 #include <sys/wait.h>
Andrew Geissler595f6302022-01-24 19:11:47 +000023
24+#if !defined(__GLIBC__)
25+#include <string.h>
26+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
27+#endif
28+
29 #include "alloc-util.h"
30 #include "bus-common-errors.h"
31 #include "bus-get-properties.h"
Patrick Williamsda295312023-12-05 16:48:56 -060032--
332.39.2
34