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
21a146d2
Commit
21a146d2
authored
Jun 16, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file: use fdopendir to open a dir from a fd
parent
dd0ff262
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
modules/access/directory.c
modules/access/directory.c
+12
-5
modules/access/file.c
modules/access/file.c
+6
-2
No files found.
modules/access/directory.c
View file @
21a146d2
...
@@ -54,18 +54,17 @@ struct access_sys_t
...
@@ -54,18 +54,17 @@ struct access_sys_t
};
};
/*****************************************************************************
/*****************************************************************************
*
Open: open the directory
*
DirInit: Init the directory access with a directory stream
*****************************************************************************/
*****************************************************************************/
int
Dir
Open
(
vlc_object_t
*
p_this
)
int
Dir
Init
(
access_t
*
p_access
,
DIR
*
p_dir
)
{
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
DIR
*
p_dir
;
char
*
psz_base_uri
;
char
*
psz_base_uri
;
if
(
!
p_access
->
psz_filepath
)
if
(
!
p_access
->
psz_filepath
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
p_dir
=
vlc_opendir
(
p_access
->
psz_filepath
);
if
(
!
p_dir
)
p_dir
=
vlc_opendir
(
p_access
->
psz_filepath
);
if
(
p_dir
==
NULL
)
if
(
p_dir
==
NULL
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -98,6 +97,14 @@ int DirOpen (vlc_object_t *p_this)
...
@@ -98,6 +97,14 @@ int DirOpen (vlc_object_t *p_this)
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
* DirOpen: Open the directory access
*****************************************************************************/
int
DirOpen
(
vlc_object_t
*
p_this
)
{
return
DirInit
((
access_t
*
)
p_this
,
NULL
);
}
/*****************************************************************************
/*****************************************************************************
* Close: close the target
* Close: close the target
*****************************************************************************/
*****************************************************************************/
...
...
modules/access/file.c
View file @
21a146d2
...
@@ -205,8 +205,12 @@ int FileOpen( vlc_object_t *p_this )
...
@@ -205,8 +205,12 @@ int FileOpen( vlc_object_t *p_this )
if
(
S_ISDIR
(
st
.
st_mode
))
if
(
S_ISDIR
(
st
.
st_mode
))
{
{
#ifdef HAVE_FDOPENDIR
#ifdef HAVE_FDOPENDIR
close
(
fd
);
DIR
*
p_dir
=
fdopendir
(
fd
);
return
DirOpen
(
VLC_OBJECT
(
p_access
));
if
(
!
p_dir
)
{
msg_Err
(
p_access
,
"fdopendir error: %s"
,
vlc_strerror_c
(
errno
));
goto
error
;
}
return
DirInit
(
p_access
,
p_dir
);
#else
#else
msg_Dbg
(
p_access
,
"ignoring directory"
);
msg_Dbg
(
p_access
,
"ignoring directory"
);
goto
error
;
goto
error
;
...
...
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