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
5206c714
Commit
5206c714
authored
Sep 01, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Sep 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: Use posix_spawn() instead of fork()/execvp().
parent
757ea81a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
tools.h
tools/tools.h
+5
-7
No files found.
tools/tools.h
View file @
5206c714
...
...
@@ -57,6 +57,8 @@
# define strcasecmp _stricmp
# endif
#else
extern
char
**
environ
;
# include <spawn.h>
# include <sys/wait.h>
# include <unistd.h>
# ifndef O_BINARY
...
...
@@ -283,13 +285,9 @@ static inline int strarray_spawn( struct strarray args )
pid_t
pid
,
wret
;
int
status
;
if
(
!
(
pid
=
fork
()))
{
strarray_add
(
&
args
,
NULL
);
execvp
(
args
.
str
[
0
],
(
char
**
)
args
.
str
);
_exit
(
1
);
}
if
(
pid
==
-
1
)
return
-
1
;
strarray_add
(
&
args
,
NULL
);
if
(
posix_spawnp
(
&
pid
,
args
.
str
[
0
],
NULL
,
NULL
,
(
char
**
)
args
.
str
,
environ
))
return
-
1
;
while
(
pid
!=
(
wret
=
waitpid
(
pid
,
&
status
,
0
)))
if
(
wret
==
-
1
&&
errno
!=
EINTR
)
break
;
...
...
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