diff options
author | Roland McGrath <roland@hack.frob.com> | 2015-05-13 12:34:11 -0700 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2015-05-13 12:34:11 -0700 |
commit | d2ee815ad677bba720c4f0275c1d6065f5809e7a (patch) | |
tree | bdf787aecee9e951a71ce1d852e26b4412743803 /dirent/scandir.c | |
parent | 83c10893259916152d277327fa37d8f70bb4d4c2 (diff) | |
download | glibc-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.c | 19 |
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 |