Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5802fdf3
Commit
5802fdf3
authored
Mar 18, 2012
by
Ross Lagerwall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
Based on patch from Hervé Coatanhay.
parent
7dabfede
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Modules/_posixsubprocess.c
Modules/_posixsubprocess.c
+12
-1
No files found.
Modules/_posixsubprocess.c
View file @
5802fdf3
...
@@ -204,7 +204,18 @@ _close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
...
@@ -204,7 +204,18 @@ _close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
int
fd_dir_fd
;
int
fd_dir_fd
;
if
(
start_fd
>=
end_fd
)
if
(
start_fd
>=
end_fd
)
return
;
return
;
#ifdef O_CLOEXEC
fd_dir_fd
=
open
(
FD_DIR
,
O_RDONLY
|
O_CLOEXEC
,
0
);
fd_dir_fd
=
open
(
FD_DIR
,
O_RDONLY
|
O_CLOEXEC
,
0
);
#else
fd_dir_fd
=
open
(
FD_DIR
,
O_RDONLY
,
0
);
#ifdef FD_CLOEXEC
{
int
old
=
fcntl
(
fd_dir_fd
,
F_GETFD
);
if
(
old
!=
-
1
)
fcntl
(
fd_dir_fd
,
F_SETFD
,
old
|
FD_CLOEXEC
);
}
#endif
#endif
if
(
fd_dir_fd
==
-
1
)
{
if
(
fd_dir_fd
==
-
1
)
{
/* No way to get a list of open fds. */
/* No way to get a list of open fds. */
_close_fds_by_brute_force
(
start_fd
,
end_fd
,
py_fds_to_keep
);
_close_fds_by_brute_force
(
start_fd
,
end_fd
,
py_fds_to_keep
);
...
...
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