* eina: use fstatat when available.

Maybe we could add an eina_file_lstat_ls.


SVN revision: 54108
This commit is contained in:
Cedric BAIL 2010-11-02 17:47:19 +00:00
parent 058deb3c1f
commit 19bce347b0
2 changed files with 16 additions and 0 deletions

View File

@ -522,6 +522,14 @@ if test "x${have_iconv}" = "xyes" ; then
AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
fi
#check for dirfd API presence
have_dirfd="no"
AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
if test "x${dirfd}" = "xyes"; then
AC_DEFINE(HAVE_DIRFD)
fi
AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
### Modules
@ -626,6 +634,7 @@ echo " debug usage........: ${have_debug_threads}"
fi
echo " Amalgamation.........: ${do_amalgamation}"
echo " Iconv support........: ${have_iconv}"
echo " File dirfd...........: ${have_dirfd}"
echo
echo " Documentation........: ${build_doc}"
echo " Tests................: ${enable_tests}"

View File

@ -240,7 +240,14 @@ _eina_file_stat_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data)
if (it->info.type == EINA_FILE_UNKNOWN)
{
#ifdef HAVE_FSTATAT
int fd;
fd = dirfd(it->dirp);
if (fstatat(fd, it->info.path + it->info.name_start, &st, 0))
#else
if (stat(it->info.path, &st))
#endif
it->info.type = EINA_FILE_UNKNOWN;
else
{