[vlc-commits] configure: test for fstatat() rather than openat()
Rémi Denis-Courmont
git at videolan.org
Sat Sep 21 11:49:10 CEST 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 21 12:47:18 2019 +0300| [55a4936a6d29d54b8d8237858bb50ab283138a0b] | committer: Rémi Denis-Courmont
configure: test for fstatat() rather than openat()
It does not make much difference in practice as they should always
come together, but fstatat() is what the code base uses conditionally.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55a4936a6d29d54b8d8237858bb50ab283138a0b
---
configure.ac | 2 +-
modules/access/directory.c | 2 +-
test/libvlc/media.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index d9c9c9ee65..210b4ca537 100644
--- a/configure.ac
+++ b/configure.ac
@@ -633,7 +633,7 @@ dnl Check for system libs needed
need_libc=false
dnl Check for usual libc functions
-AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
+AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatat fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 0057b5d93e..8fa3c0a5e3 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -124,7 +124,7 @@ int DirRead (stream_t *access, input_item_node_t *node)
struct stat st;
int type;
-#ifdef HAVE_OPENAT
+#ifdef HAVE_FSTATAT
if (fstatat(dirfd(sys->dir), entry, &st, 0))
continue;
#else
diff --git a/test/libvlc/media.c b/test/libvlc/media.c
index 285fed32bc..726cf925df 100644
--- a/test/libvlc/media.c
+++ b/test/libvlc/media.c
@@ -308,8 +308,8 @@ static void test_media_subitems(libvlc_instance_t *vlc)
}
free (subitems_realpath);
-#ifdef HAVE_OPENAT
- /* listing directory via a fd works only if HAVE_OPENAT is defined */
+#ifdef HAVE_FSTATAT
+ /* listing directory via a fd works only if fstatat() exists */
int fd = open (subitems_path, O_RDONLY);
test_log ("Testing media_subitems: fd: '%d'\n", fd);
assert (fd >= 0);
More information about the vlc-commits
mailing list