Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f9812a51
Commit
f9812a51
authored
Jun 20, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: do not get stuck on a FIFO (fix #6940)
Also avoid fstat()+close() on non-directoy files.
parent
bd19904c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
modules/access/directory.c
modules/access/directory.c
+9
-12
No files found.
modules/access/directory.c
View file @
f9812a51
...
...
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
# include <fcntl.h>
...
...
@@ -324,22 +325,18 @@ block_t *DirBlock (access_t *p_access)
{
DIR
*
handle
;
#ifdef HAVE_OPENAT
int
fd
=
vlc_openat
(
dirfd
(
current
->
handle
),
entry
,
O_RDONLY
);
int
fd
=
vlc_openat
(
dirfd
(
current
->
handle
),
entry
,
O_RDONLY
|
O_DIRECTORY
);
if
(
fd
==
-
1
)
goto
skip
;
/* File cannot be opened... forget it */
struct
stat
st
;
if
(
fstat
(
fd
,
&
st
))
{
close
(
fd
);
goto
skip
;
/* cannot stat?! */
}
if
(
!
S_ISDIR
(
st
.
st_mode
))
{
close
(
fd
);
if
(
errno
==
ENOTDIR
)
goto
notdir
;
goto
skip
;
/* File cannot be opened... forget it */
}
if
(
p_sys
->
mode
==
MODE_NONE
struct
stat
st
;
if
(
fstat
(
fd
,
&
st
)
||
p_sys
->
mode
==
MODE_NONE
||
has_inode_loop
(
current
,
st
.
st_dev
,
st
.
st_ino
)
||
(
handle
=
fdopendir
(
fd
))
==
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment