Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7f3120af
Commit
7f3120af
authored
Mar 19, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
posix: open directories with close-on-exec flag
parent
2a2bb7af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/posix/filesystem.c
src/posix/filesystem.c
+9
-7
No files found.
src/posix/filesystem.c
View file @
7f3120af
...
@@ -162,15 +162,17 @@ int vlc_mkdir (const char *dirname, mode_t mode)
...
@@ -162,15 +162,17 @@ int vlc_mkdir (const char *dirname, mode_t mode)
*/
*/
DIR
*
vlc_opendir
(
const
char
*
dirname
)
DIR
*
vlc_opendir
(
const
char
*
dirname
)
{
{
const
char
*
local_name
=
ToLocale
(
dirname
);
#ifdef O_DIRECTORY
if
(
unlikely
(
local_name
==
NULL
))
int
fd
=
vlc_open
(
dirname
,
O_RDONLY
|
O_DIRECTORY
);
{
#else
/* If O_DIRECTORY is missing. fdopendir() will deal with ENOTDIR. */
errno
=
ENOENT
;
int
fd
=
vlc_open
(
dirname
,
O_RDONLY
);
#endif
if
(
fd
==
-
1
)
return
NULL
;
return
NULL
;
}
DIR
*
dir
=
opendir
(
local_name
);
DIR
*
dir
=
fdopendir
(
fd
);
LocaleFree
(
local_name
);
if
(
dir
==
NULL
)
close
(
fd
);
return
dir
;
return
dir
;
}
}
...
...
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