summaryrefslogtreecommitdiff
path: root/src/preproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/preproc.c')
-rw-r--r--src/preproc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/preproc.c b/src/preproc.c
index 8d5525e..7e93b4c 100644
--- a/src/preproc.c
+++ b/src/preproc.c
@@ -44,10 +44,18 @@ char* get_cmdsub_output(TokenVec sub_region, ShellState* shstate) {
pipe(pipe_fds);
PipelineTree sub_tree = process_ast(sub_region, shstate);
+ printf("AST done\n");
// TODO: tree cleanup
+
+ // TODO: is this ok? where should we manage the pgid?
+ int pgid = -1;
+ Channel write_cha = {.fd = pipe_fds[1], .parent_proc_closable = false, .child_proc_closable = true};
+ execute_command_pipeline(*sub_tree.root, STDIN_CHA, write_cha, true, &pgid, shstate);
+ close(pipe_fds[1]);
//execute_pipeline_tree(*sub_tree.root, shstate, STDIN_FILENO, pipe_fds[1]);
+ printf("Execution done\n");
String output_buf = make_String(256);
char str_buf[256];
@@ -56,7 +64,6 @@ char* get_cmdsub_output(TokenVec sub_region, ShellState* shstate) {
append_str_to_String(&output_buf, str_buf);
}
close(pipe_fds[0]);
- close(pipe_fds[1]);
return inner(&output_buf);
}