mirror of
https://github.com/SELinuxProject/selinux
synced 2025-05-10 03:28:05 +00:00
libsemanage: Mimic GNU basename() API for non-glibc library e.g. musl
musl only provides POSIX version of basename and it has also removed providing it via string.h header [1] which now results in compile errors with newer compilers e.g. clang-18 [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
This commit is contained in:
parent
e79a14c77b
commit
4d0f8cae5a
@ -63,6 +63,9 @@
|
||||
#define PIPE_READ 0
|
||||
#define PIPE_WRITE 1
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#if !defined(__GLIBC__)
|
||||
#define basename(src) (strrchr(src, '/') ? strrchr(src, '/') + 1 : src)
|
||||
#endif
|
||||
|
||||
static void semanage_direct_destroy(semanage_handle_t * sh);
|
||||
static int semanage_direct_disconnect(semanage_handle_t * sh);
|
||||
|
Loading…
Reference in New Issue
Block a user