diff options
Diffstat (limited to 'src/exec.c')
| -rw-r--r-- | src/exec.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -78,16 +78,17 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd) { push_to_StrVec(&arg_vec, strdup(pname)); break; case ARG_PS_OUT: + // TODO: do waiting correctly pipe(ps_pipe_fds); - execute_command_pipeline(*(Pipeline*)arg.as.sub_pipeline, ps_pipe_fds[0], STDOUT_FILENO); // TODO: don't do fcntl? fcntl(ps_pipe_fds[1], F_SETFD, FD_CLOEXEC); - execute_command_pipeline(*(Pipeline*)arg.as.sub_pipeline, STDIN_FILENO, ps_pipe_fds[1]); + execute_command_pipeline(*(Pipeline*)arg.as.sub_pipeline, ps_pipe_fds[0], STDOUT_FILENO); fcntl(ps_pipe_fds[1], F_SETFD, 0); close(ps_pipe_fds[0]); char name[64]; snprintf(name, sizeof(name), "/dev/fd/%d", ps_pipe_fds[1]); + push_to_IntVec(&parent_open_fds, ps_pipe_fds[1]); push_to_StrVec(&arg_vec, strdup(name)); break; default: |
