summaryrefslogtreecommitdiffstats
path: root/libc/misc/ftw
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/ftw')
-rw-r--r--libc/misc/ftw/Makefile45
-rw-r--r--libc/misc/ftw/ftw.c16
2 files changed, 19 insertions, 42 deletions
diff --git a/libc/misc/ftw/Makefile b/libc/misc/ftw/Makefile
index a8d52bf32..4a8f4a072 100644
--- a/libc/misc/ftw/Makefile
+++ b/libc/misc/ftw/Makefile
@@ -1,42 +1,13 @@
# Makefile for uClibc
#
-# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Library General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option) any
-# later version.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-TOPDIR=../../../
-include $(TOPDIR)Rules.mak
-
-CSRC=ftw.c
-COBJS=$(patsubst %.c,%.o, $(CSRC))
-OBJS=$(COBJS)
-
-MSRC=ftw.c
-MOBJ=ftw.o ftw64.o
-OBJS=$(MOBJ)
-
-OBJ_LIST=../../obj.misc.ftw
-
-all: $(OBJ_LIST)
-
-$(OBJ_LIST): $(OBJS)
- echo $(patsubst %, misc/ftw/%, $(OBJS)) > $(OBJ_LIST)
-
-$(MOBJ): $(MSRC)
- $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
- $(STRIPTOOL) -x -R .note -R .comment $*.o
-clean:
- $(RM) *.[oa] *~ core
+top_srcdir=../../../
+top_builddir=../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index e58c3e6ca..c36ae45b6 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -18,6 +18,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+/* used by D_EXACT_NAMLEN */
+#define strlen __strlen
+
+#define mempcpy __mempcpy
+#define tsearch __tsearch
+
#define _GNU_SOURCE
#include <features.h>
@@ -421,7 +427,7 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
/* Next, update the `struct FTW' information. */
++data->ftw.level;
- startp = strchr (data->dirbuf, '\0');
+ startp = __strchr (data->dirbuf, '\0');
/* There always must be a directory name. */
assert (startp != data->dirbuf);
if (startp[-1] != '/')
@@ -457,7 +463,7 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
while (result == 0 && *runp != '\0')
{
- char *endp = strchr (runp, '\0');
+ char *endp = __strchr (runp, '\0');
result = process_entry (data, &dir, runp, endp - runp);
@@ -498,7 +504,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, int flag
__set_errno (ENOENT);
return -1;
}
- if ((strlen(dir)+1) > NAME_MAX) {
+ if ((__strlen(dir)+1) > NAME_MAX) {
__set_errno(ENAMETOOLONG);
return -1;
}
@@ -507,10 +513,10 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, int flag
data.actdir = 0;
data.dirstreams = (struct dir_data **) alloca (data.maxdir
* sizeof (struct dir_data *));
- memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *));
+ __memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *));
/* PATH_MAX is always defined when we get here. */
- data.dirbufsize = MAX (2 * strlen (dir), PATH_MAX);
+ data.dirbufsize = MAX (2 * __strlen (dir), PATH_MAX);
data.dirbuf = (char *) malloc (data.dirbufsize);
if (data.dirbuf == NULL)
return -1;