[Toybox] [PATCH] fix non-glibc basename(3) usage

enh enh at google.com
Wed Jan 14 17:13:19 PST 2015


I considered a #else on the big #ifdef __GLIBC__ above, but that
seemed harder to follow.

diff --git a/lib/portability.h b/lib/portability.h
index 8bbbdb2..f262a93 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -141,6 +141,11 @@ int utimensat(int fd, const char *path, const
struct timespec times[2], int flag

 #endif

+#ifndef __GLIBC__
+// POSIX basename.
+#include <libgen.h>
+#endif
+
 #ifdef __MUSL__
 #include <unistd.h>
 // Without this "rm -r dir" fails with "is directory".

 1421284399.0


More information about the Toybox mailing list