stop declariong our own dirname prototype
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 10 Sep 2011 11:48:34 +0000 (13:48 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 10 Sep 2011 11:48:34 +0000 (13:48 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/libbb.h
modutils/modutils-24.c

index f60f427..d0c7ace 100644 (file)
 #include <stdarg.h>
 #include <stddef.h>
 #include <string.h>
+/* There are two incompatible basename's, let not use them! */
+/* See the dirname/basename man page for details */
+#include <libgen.h> /* dirname,basename */
+#undef basename
+#define basename dont_use_basename
 #include <sys/poll.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -133,12 +138,6 @@ int vdprintf(int d, const char *format, va_list ap);
 #endif
 /* klogctl is in libc's klog.h, but we cheat and not #include that */
 int klogctl(int type, char *b, int len);
-/* This is declared here rather than #including <libgen.h> in order to avoid
- * confusing the two versions of basename.  See the dirname/basename man page
- * for details. */
-#if !defined __FreeBSD__
-char *dirname(char *path);
-#endif
 #ifndef PATH_MAX
 # define PATH_MAX 256
 #endif
index bbc54e3..12cb75c 100644 (file)
@@ -60,7 +60,6 @@
 
 #include "libbb.h"
 #include "modutils.h"
-#include <libgen.h>
 #include <sys/utsname.h>
 
 #if ENABLE_FEATURE_INSMOD_LOADINKMEM