[vlc-devel] commit: Do not stat directories on Windows ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Sep 30 22:07:01 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Sep 30 23:08:34 2008 +0300| [9cb82b16cdfdffe85b039c26ba851c10ae7d1e18] | committer: Rémi Denis-Courmont 

Do not stat directories on Windows

For lack of a better solution, I assume that Windows has a finite
paths length limit to prevent infinite recursion. Otherwise we need
dirfd() and unique inodes.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9cb82b16cdfdffe85b039c26ba851c10ae7d1e18
---

 modules/access/directory.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index 63e4c84..03d8df0 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -45,12 +45,6 @@
 #   include <unistd.h>
 #elif defined( WIN32 ) && !defined( UNDER_CE )
 #   include <io.h>
-static inline int dirfd (void *dir)
-{
-    return -1;
-}
-#elif defined( UNDER_CE )
-#   define strcoll strcmp
 #endif
 
 #ifdef HAVE_DIRENT_H
@@ -119,7 +113,9 @@ struct directory_t
     directory_t *parent;
     DIR         *handle;
     char        *uri;
+#ifndef WIN32
     struct stat  st;
+#endif
     char         path[1];
 };
 
@@ -225,12 +221,16 @@ static char *encode_path (const char *path)
 /* Detect directories that recurse into themselves. */
 static bool has_inode_loop (const directory_t *dir)
 {
+#ifndef WIN32
     dev_t dev = dir->st.st_dev;
     ino_t inode = dir->st.st_ino;
 
     while ((dir = dir->parent) != NULL)
         if ((dir->st.st_dev == dev) && (dir->st.st_ino == inode))
             return true;
+#else
+# define fstat( fd, st ) (0)
+#endif
     return false;
 }
 




More information about the vlc-devel mailing list