mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 07:12:26 -08:00
Use dup2() instead of dup() when executing child processes (more portable, due to use of STD*_FILENO?)
This commit is contained in:
parent
4fd77c7963
commit
0e644e3340
1 changed files with 3 additions and 6 deletions
|
|
@ -549,14 +549,11 @@ make_windows_handle(HANDLE h)
|
|||
/* Child */
|
||||
int j;
|
||||
void **argv_ptr = (void **)argv->vector.self.t;
|
||||
close(0);
|
||||
dup(child_stdin);
|
||||
dup2(child_stdin, STDIN_FILENO);
|
||||
if (parent_write) close(parent_write);
|
||||
close(1);
|
||||
dup(child_stdout);
|
||||
dup2(child_stdout, STDOUT_FILENO);
|
||||
if (parent_read) close(parent_read);
|
||||
close(2);
|
||||
dup(child_stderr);
|
||||
dup2(child_stderr, STDERR_FILENO);
|
||||
for (j = 0; j < argv->vector.fillp; j++) {
|
||||
cl_object arg = argv->vector.self.t[j];
|
||||
if (arg == Cnil) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue