mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Revamp posix_spawn() implementation
This commit is contained in:
parent
b41f91c658
commit
0cee831da3
15 changed files with 383 additions and 215 deletions
|
@ -54,7 +54,7 @@ FILE *popen(const char *cmdline, const char *mode) {
|
|||
switch ((pid = fork())) {
|
||||
case 0:
|
||||
_unassert(dup2(pipefds[!dir], !dir) == !dir);
|
||||
// we can't rely on cloexec because cocmd builtins don't execev
|
||||
// we can't rely on cloexec because cocmd builtins don't execve
|
||||
if (pipefds[0] != !dir) _unassert(!close(pipefds[0]));
|
||||
if (pipefds[1] != !dir) _unassert(!close(pipefds[1]));
|
||||
_Exit(cocmd(3, (char *[]){"popen", "-c", cmdline, 0}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue