fix non-glibc basename(3) usage
authorElliott Hughes <enh@google.com>
Sun, 18 Jan 2015 19:36:31 +0000 (13:36 -0600)
committerElliott Hughes <enh@google.com>
Sun, 18 Jan 2015 19:36:31 +0000 (13:36 -0600)
I considered a #else on the big #ifdef __GLIBC__ above, but that
seemed harder to follow.

lib/portability.h

index f6f7672..bb1f5ae 100644 (file)
@@ -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".