From f4b209f1622afd61cf146f7e52bc455ed790c703 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Thu, 21 May 2026 16:02:56 +0200 Subject: further work on proc sub --- src/exec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/exec.c b/src/exec.c index b34472c..95ba31f 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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: -- cgit v1.2.3