* eina: use fstatat when available.
Maybe we could add an eina_file_lstat_ls. SVN revision: 54108
This commit is contained in:
parent
058deb3c1f
commit
19bce347b0
|
@ -522,6 +522,14 @@ if test "x${have_iconv}" = "xyes" ; then
|
||||||
AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
|
AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
|
||||||
fi
|
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
|
### Modules
|
||||||
|
|
||||||
|
@ -626,6 +634,7 @@ echo " debug usage........: ${have_debug_threads}"
|
||||||
fi
|
fi
|
||||||
echo " Amalgamation.........: ${do_amalgamation}"
|
echo " Amalgamation.........: ${do_amalgamation}"
|
||||||
echo " Iconv support........: ${have_iconv}"
|
echo " Iconv support........: ${have_iconv}"
|
||||||
|
echo " File dirfd...........: ${have_dirfd}"
|
||||||
echo
|
echo
|
||||||
echo " Documentation........: ${build_doc}"
|
echo " Documentation........: ${build_doc}"
|
||||||
echo " Tests................: ${enable_tests}"
|
echo " Tests................: ${enable_tests}"
|
||||||
|
|
|
@ -240,7 +240,14 @@ _eina_file_stat_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data)
|
||||||
|
|
||||||
if (it->info.type == EINA_FILE_UNKNOWN)
|
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))
|
if (stat(it->info.path, &st))
|
||||||
|
#endif
|
||||||
it->info.type = EINA_FILE_UNKNOWN;
|
it->info.type = EINA_FILE_UNKNOWN;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue