need_libc=false
dnl Check for usual libc functions
-AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fork getenv getpwuid_r gettimeofday isatty lstat memalign posix_fadvise posix_madvise posix_memalign putenv setenv setlocale stricmp strnicmp tdestroy uselocale])
+AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fork getenv getpwuid_r gettimeofday isatty lstat memalign openat posix_fadvise posix_madvise posix_memalign putenv setenv setlocale stricmp strnicmp tdestroy uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
#ifndef WIN32
struct stat st;
#endif
-#ifndef HAVE_FDOPENDIR
+#ifndef HAVE_OPENAT
char *path;
#endif
};
p_sys->current = current->parent;
closedir (current->handle);
free (current->uri);
-#ifndef HAVE_FDOPENDIR
+#ifndef HAVE_OPENAT
free (current->path);
#endif
free (current);
}
current->parent = NULL;
current->handle = p_sys->handle;
-#ifndef HAVE_FDOPENDIR
+#ifndef HAVE_OPENAT
current->path = strdup (p_access->psz_path);
#endif
current->uri = p_sys->uri;
closedir (current->handle);
p_sys->current = current->parent;
free (current->uri);
-#ifndef HAVE_FDOPENDIR
+#ifndef HAVE_OPENAT
free (current->path);
#endif
free (current);
}
DIR *handle;
-#ifdef HAVE_FDOPENDIR
+#ifdef HAVE_OPENAT
int fd = vlc_openat (dirfd (current->handle), entry, O_RDONLY);
if (fd != -1)
{
if (*end == '\0')
fd = vlc_dup (oldfd);
-#ifdef HAVE_FDOPENDIR
else if (*end == '/' && end > path)
{
char *name = decode_URI_duplicate (end - 1);
free (name);
}
}
-#endif
}
else
{
return -1;
}
-#ifdef HAVE_FDOPENDIR
+#ifdef HAVE_OPENAT
int fd = openat (dir, local_name, flags, mode);
# ifdef HAVE_FCNTL
if (fd != -1)