Commit 48b680eb authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

Don't stat the dir if we are gonna open it one call later.

Changed debug msg's to make sure they don't become annoying.
parent 0c53675c
...@@ -152,10 +152,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -152,10 +152,6 @@ static int Open( vlc_object_t *p_this )
if( !p_access->psz_path ) if( !p_access->psz_path )
return VLC_EGENERIC; return VLC_EGENERIC;
struct stat st;
if( !stat( p_access->psz_path, &st ) && !S_ISDIR( st.st_mode ) )
return VLC_EGENERIC;
DIR *handle = OpenDir (p_this, p_access->psz_path); DIR *handle = OpenDir (p_this, p_access->psz_path);
if (handle == NULL) if (handle == NULL)
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -573,18 +569,17 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist, ...@@ -573,18 +569,17 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist,
static DIR *OpenDir (vlc_object_t *obj, const char *path) static DIR *OpenDir (vlc_object_t *obj, const char *path)
{ {
msg_Dbg (obj, "opening directory `%s'", path);
DIR *handle = utf8_opendir (path); DIR *handle = utf8_opendir (path);
if (handle == NULL) if (handle == NULL)
{ {
int err = errno; int err = errno;
if (err != ENOTDIR) if (err != ENOTDIR)
msg_Err (obj, "%s: %m", path); msg_Err (obj, "%s: %m", path);
else // else not a dir
msg_Dbg (obj, "skipping non-directory `%s'", path);
errno = err; errno = err;
return NULL; return NULL;
} }
msg_Dbg (obj, "opening directory `%s'", path);
return handle; return handle;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment