Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 1 | From d0bdce977b7acc5e45e82cf84256c4bedc0e74c4 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 27 May 2018 08:36:44 -0700 |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 4 | Subject: [PATCH] Define glibc compatible basename() for non-glibc systems |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | |
| 6 | Fixes builds with musl, even though systemd is adamant about |
| 7 | using non-posix basename implementation, we have a way out |
| 8 | |
| 9 | Upstream-Status: Inappropriate [musl specific] |
| 10 | |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 12 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 13 | --- |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | src/machine/machine-dbus.c | 5 +++++ |
| 15 | 1 file changed, 5 insertions(+) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 17 | --- a/src/machine/machine-dbus.c |
| 18 | +++ b/src/machine/machine-dbus.c |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 19 | @@ -4,6 +4,11 @@ |
| 20 | #include <sys/mount.h> |
| 21 | #include <sys/wait.h> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | |
| 23 | +#if !defined(__GLIBC__) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | +#include <string.h> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | +#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) |
| 26 | +#endif |
| 27 | + |
| 28 | #include "alloc-util.h" |
| 29 | #include "bus-common-errors.h" |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 30 | #include "bus-get-properties.h" |