Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
887af612
Commit
887af612
authored
Jul 01, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Avoid the close-on-exec race with pipe() on kernels that support pipe2().
parent
6f68b774
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
process.c
dlls/kernel32/process.c
+10
-4
No files found.
dlls/kernel32/process.c
View file @
887af612
...
...
@@ -1304,12 +1304,18 @@ static int fork_and_exec( const char *filename, const WCHAR *cmdline, const WCHA
if
(
!
env
)
env
=
GetEnvironmentStringsW
();
if
(
pipe
(
fd
)
==
-
1
)
#ifdef HAVE_PIPE2
if
(
pipe2
(
fd
,
O_CLOEXEC
)
==
-
1
)
#endif
{
SetLastError
(
ERROR_TOO_MANY_OPEN_FILES
);
return
-
1
;
if
(
pipe
(
fd
)
==
-
1
)
{
SetLastError
(
ERROR_TOO_MANY_OPEN_FILES
);
return
-
1
;
}
fcntl
(
fd
[
0
],
F_SETFD
,
FD_CLOEXEC
);
fcntl
(
fd
[
1
],
F_SETFD
,
FD_CLOEXEC
);
}
fcntl
(
fd
[
1
],
F_SETFD
,
1
);
/* set close on exec */
if
(
!
(
flags
&
(
CREATE_NEW_PROCESS_GROUP
|
CREATE_NEW_CONSOLE
|
DETACHED_PROCESS
)))
{
...
...
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