summaryrefslogtreecommitdiff
path: root/src/exec.c
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-21 15:30:50 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-21 15:30:50 +0200
commit16865db3c000e4900c202d0e7d6aa5e7ed2043ca (patch)
tree5c1e22add7250af7cac6aab75954ef7e3b50c6bb /src/exec.c
parent505a87c24cb4e4ae8a3d5410912bcc6633e9e161 (diff)
trying to make out-procsub work
Diffstat (limited to 'src/exec.c')
-rw-r--r--src/exec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/exec.c b/src/exec.c
index 4a35142..b34472c 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -77,6 +77,19 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd) {
push_to_IntVec(&parent_open_fds, ps_pipe_fds[0]);
push_to_StrVec(&arg_vec, strdup(pname));
break;
+ case ARG_PS_OUT:
+ 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]);
+ 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_StrVec(&arg_vec, strdup(name));
+ break;
default:
exit(67);
}