blob: 3228f1716bc8dc5feb7c558f466454342d9fdfc9 [file] [log] [blame]
Andrew Geisslerd5838332022-05-27 11:33:10 -05001From d0bdce977b7acc5e45e82cf84256c4bedc0e74c4 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
William A. Kennington IIIac69b482021-06-02 12:28:27 -07004Subject: [PATCH] Define glibc compatible basename() for non-glibc systems
Brad Bishop19323692019-04-05 15:28:33 -04005
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>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070012
Brad Bishop19323692019-04-05 15:28:33 -040013---
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 -060017--- a/src/machine/machine-dbus.c
18+++ b/src/machine/machine-dbus.c
Andrew Geissler517393d2023-01-13 08:55:19 -060019@@ -4,6 +4,11 @@
20 #include <sys/mount.h>
21 #include <sys/wait.h>
Brad Bishop19323692019-04-05 15:28:33 -040022
23+#if !defined(__GLIBC__)
Andrew Geissler82c905d2020-04-13 13:39:40 -050024+#include <string.h>
Brad Bishop19323692019-04-05 15:28:33 -040025+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
26+#endif
27+
28 #include "alloc-util.h"
29 #include "bus-common-errors.h"
Andrew Geissler635e0e42020-08-21 15:58:33 -050030 #include "bus-get-properties.h"