0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch 858 B

12345678910111213141516171819202122232425262728293031
  1. From d0bdce977b7acc5e45e82cf84256c4bedc0e74c4 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sun, 27 May 2018 08:36:44 -0700
  4. Subject: [PATCH] Define glibc compatible basename() for non-glibc systems
  5. Fixes builds with musl, even though systemd is adamant about
  6. using non-posix basename implementation, we have a way out
  7. Upstream-Status: Inappropriate [musl specific]
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. src/machine/machine-dbus.c | 5 +++++
  11. 1 file changed, 5 insertions(+)
  12. --- a/src/machine/machine-dbus.c
  13. +++ b/src/machine/machine-dbus.c
  14. @@ -4,6 +4,11 @@
  15. #include <sys/mount.h>
  16. #include <sys/wait.h>
  17. +#if !defined(__GLIBC__)
  18. +#include <string.h>
  19. +#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
  20. +#endif
  21. +
  22. #include "alloc-util.h"
  23. #include "bus-common-errors.h"
  24. #include "bus-get-properties.h"