]> git.sesse.net Git - vlc/commitdiff
directory: do not try to open "-" as it refers to stdin
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 22 Oct 2008 20:59:00 +0000 (23:59 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 22 Oct 2008 20:59:00 +0000 (23:59 +0300)
This removes a silly error message.

modules/access/directory.c

index cb724dc87797e6cbabec296b0373201af3e45d80..aba105f1487285d1517a92f9017659e98541fa7e 100644 (file)
@@ -143,7 +143,22 @@ static int Open( vlc_object_t *p_this )
     if( !p_access->psz_path )
         return VLC_EGENERIC;
 
     if( !p_access->psz_path )
         return VLC_EGENERIC;
 
-    DIR *handle = utf8_opendir (p_access->psz_path);
+    DIR *handle;
+    if (strcmp (p_access->psz_path, "-"))
+        handle = utf8_opendir (p_access->psz_path);
+    else
+    {
+#if 0   /* This won't work yet, it generates paths like "-/music.ogg".
+         * We'd need to use openat() here and in the file access... */
+        int fd = dup (0);
+        handle = fdopendir (fd);
+        if (handle == NULL)
+            close (fd);
+#else
+        return VLC_EGENERIC;
+#endif
+    }
+
     if (handle == NULL)
         return VLC_EGENERIC;
 
     if (handle == NULL)
         return VLC_EGENERIC;