[vlc-devel] commit: No need to do stat() before opendir()! ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue May 20 18:02:23 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Tue May 20 18:50:42 2008 +0300| [04aae4db17b7b59c04870677448a0b49262b5f71]

No need to do stat() before opendir()!

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

 modules/misc/lua/net.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/modules/misc/lua/net.c b/modules/misc/lua/net.c
index 2a2fde4..70827e7 100644
--- a/modules/misc/lua/net.c
+++ b/modules/misc/lua/net.c
@@ -283,13 +283,7 @@ int vlclua_opendir( lua_State *L )
     const char *psz_dir = luaL_checkstring( L, 1 );
     DIR *p_dir;
     int i = 0;
-#ifdef HAVE_SYS_STAT_H
-    struct stat s;
-    if( utf8_stat( psz_dir, &s ) == -1 )
-        return luaL_error( L, "Error while trying to stat `%s'.", psz_dir );
-    if( !S_ISDIR( s.st_mode ) )
-        return luaL_error( L, "`%s' is not a directory.", psz_dir );
-#endif
+
     if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
         return luaL_error( L, "cannot open directory `%s'.", psz_dir );
 




More information about the vlc-devel mailing list