summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-01-18 13:36:31 -0600
committerElliott Hughes <enh@google.com>2015-01-18 13:36:31 -0600
commite910826c812fcde8d122990a1e43e17f46b6d03f (patch)
tree799bbbe2a152f9bf2cf212e6c6d81b8d4f004160 /lib
parent0a4bd4b89f9a17e4ba8c7873d1384fb04f79b14d (diff)
downloadtoybox-e910826c812fcde8d122990a1e43e17f46b6d03f.tar.gz
toybox-e910826c812fcde8d122990a1e43e17f46b6d03f.tar.bz2
toybox-e910826c812fcde8d122990a1e43e17f46b6d03f.zip
fix non-glibc basename(3) usage
I considered a #else on the big #ifdef __GLIBC__ above, but that seemed harder to follow.
Diffstat (limited to 'lib')
-rw-r--r--lib/portability.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h
index f6f7672..bb1f5ae 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".