Changeset be24a28f94929ecca09911d4659dec0484cc1de5

Show
Ignore:
Timestamp:
20/05/08 18:01:37 (5 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1211299297 +0300
git-parent:

[31bf9857bf400f283e072f053d33f6e210f698b9]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1211298899 +0300
Message:

Don't waste stat() right before opendir().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/control/http/util.c

    r6300760 rbe24a28  
    112112    intf_sys_t     *p_sys = p_intf->p_sys; 
    113113    char           dir[MAX_DIR_SIZE]; 
    114 #ifdef HAVE_SYS_STAT_H 
    115     struct stat   stat_info; 
    116 #endif 
    117114    DIR           *p_dir; 
    118115    vlc_acl_t     *p_acl; 
     
    132129#endif 
    133130 
    134 #ifdef HAVE_SYS_STAT_H 
    135     if( utf8_stat( psz_dir, &stat_info ) == -1 || !S_ISDIR( stat_info.st_mode ) ) 
    136     { 
    137         return VLC_EGENERIC; 
    138     } 
    139 #endif 
    140  
    141131    if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL ) 
    142132    { 
    143         msg_Err( p_intf, "cannot open directory (%s)", psz_dir ); 
     133        if( errno != ENOENT && errno != ENOTDIR ) 
     134            msg_Err( p_intf, "cannot open directory (%s)", psz_dir ); 
    144135        return VLC_EGENERIC; 
    145136    }