Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
825731a1
Commit
825731a1
authored
Jan 27, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux: (try to) set close-on-exec in open() system call
This Linux-specific extension fixes the close-on-exec race.
parent
71aa05ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
src/text/filesystem.c
src/text/filesystem.c
+15
-6
No files found.
src/text/filesystem.c
View file @
825731a1
...
...
@@ -110,14 +110,23 @@ int utf8_open (const char *filename, int flags, mode_t mode)
return
-
1
;
}
int
fd
=
open
(
local_name
,
flags
,
mode
);
#ifdef HAVE_FCNTL
if
(
fd
!=
-
1
)
int
fd
;
#ifdef O_CLOEXEC
fd
=
open
(
local_name
,
flags
|
O_CLOEXEC
,
mode
);
if
(
fd
==
-
1
&&
errno
==
EINVAL
)
#endif
{
int
flags
=
fcntl
(
fd
,
F_GETFD
);
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
|
((
flags
!=
-
1
)
?
flags
:
0
));
}
fd
=
open
(
local_name
,
flags
,
mode
);
#ifdef HAVE_FCNTL
if
(
fd
!=
-
1
)
{
int
flags
=
fcntl
(
fd
,
F_GETFD
);
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
|
((
flags
!=
-
1
)
?
flags
:
0
));
}
#endif
}
LocaleFree
(
local_name
);
return
fd
;
}
...
...
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