about summary refs log tree commit diff
path: root/dirent/scandir.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-05-13 12:34:11 -0700
committerRoland McGrath <roland@hack.frob.com>2015-05-13 12:34:11 -0700
commitd2ee815ad677bba720c4f0275c1d6065f5809e7a (patch)
treebdf787aecee9e951a71ce1d852e26b4412743803 /dirent/scandir.c
parent83c10893259916152d277327fa37d8f70bb4d4c2 (diff)
downloadglibc-d2ee815ad677bba720c4f0275c1d6065f5809e7a.tar.gz
glibc-d2ee815ad677bba720c4f0275c1d6065f5809e7a.tar.xz
glibc-d2ee815ad677bba720c4f0275c1d6065f5809e7a.zip
Refactor scandir/scandirat to use common tail.
Diffstat (limited to 'dirent/scandir.c')
-rw-r--r--dirent/scandir.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/dirent/scandir.c b/dirent/scandir.c
index 99c968181c..c0c3f7a3cf 100644
--- a/dirent/scandir.c
+++ b/dirent/scandir.c
@@ -24,23 +24,20 @@
 
 #undef  scandir64
 
-#include <fcntl.h>
-
 #ifndef SCANDIR
-# define SCANDIR scandir
-# define SCANDIRAT __scandirat
-# define DIRENT_TYPE struct dirent
+# define SCANDIR        scandir
+# define SCANDIR_TAIL   __scandir_tail
+# define DIRENT_TYPE    struct dirent
 #endif
 
 
 int
-SCANDIR (dir, namelist, select, cmp)
-     const char *dir;
-     DIRENT_TYPE ***namelist;
-     int (*select) (const DIRENT_TYPE *);
-     int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
+SCANDIR (const char *dir,
+	 DIRENT_TYPE ***namelist,
+	 int (*select) (const DIRENT_TYPE *),
+	 int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **))
 {
-  return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp);
+  return SCANDIR_TAIL (__opendir (dir), namelist, select, cmp);
 }
 
 #ifdef _DIRENT_MATCHES_DIRENT64