# include <io.h>
#endif
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>
-#endif
#ifdef __sun__
static inline int dirfd (DIR *dir)
{
#ifndef WIN32
struct stat st;
#endif
-#ifndef HAVE_FDOPENDIR
+#ifndef HAVE_OPENAT
char *path;
#endif
};
{
access_t *p_access = (access_t*)p_this;
- if( !p_access->psz_path )
+ if( !p_access->psz_filepath )
return VLC_EGENERIC;
- DIR *handle = vlc_opendir (p_access->psz_path);
+ DIR *handle = vlc_opendir (p_access->psz_filepath);
if (handle == NULL)
return VLC_EGENERIC;
char *uri;
if (!strcmp (p_access->psz_access, "fd"))
{
- if (asprintf (&uri, "fd://%s", p_access->psz_path) == -1)
+ if (asprintf (&uri, "fd://%s", p_access->psz_location) == -1)
uri = NULL;
}
else
- uri = make_URI (p_access->psz_path);
+ uri = make_URI (p_access->psz_filepath, "file");
if (unlikely(uri == NULL))
goto error;
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
- current->path = strdup (p_access->psz_path);
+#ifndef HAVE_OPENAT
+ current->path = strdup (p_access->psz_filepath);
#endif
current->uri = p_sys->uri;
if (fstat (dirfd (current->handle), ¤t->st))
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
- /* TODO: ToLocale */
- int fd = openat (dirfd (current->handle), entry, O_RDONLY);
+#ifdef HAVE_OPENAT
+ int fd = vlc_openat (dirfd (current->handle), entry, O_RDONLY);
if (fd != -1)
{
handle = fdopendir (fd);