Changeset be24a28f94929ecca09911d4659dec0484cc1de5
- 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
| r6300760 |
rbe24a28 |
|
| 112 | 112 | intf_sys_t *p_sys = p_intf->p_sys; |
|---|
| 113 | 113 | char dir[MAX_DIR_SIZE]; |
|---|
| 114 | | #ifdef HAVE_SYS_STAT_H |
|---|
| 115 | | struct stat stat_info; |
|---|
| 116 | | #endif |
|---|
| 117 | 114 | DIR *p_dir; |
|---|
| 118 | 115 | vlc_acl_t *p_acl; |
|---|
| … | … | |
| 132 | 129 | #endif |
|---|
| 133 | 130 | |
|---|
| 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 | | |
|---|
| 141 | 131 | if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL ) |
|---|
| 142 | 132 | { |
|---|
| 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 ); |
|---|
| 144 | 135 | return VLC_EGENERIC; |
|---|
| 145 | 136 | } |
|---|