diff options
| author | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 14:55:38 +0200 |
|---|---|---|
| committer | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 14:55:38 +0200 |
| commit | 505a87c24cb4e4ae8a3d5410912bcc6633e9e161 (patch) | |
| tree | 80ac558442ebbce52a72705fed9f32872b3f584f /src/exec.c | |
| parent | 202f4f3a9b7818359d89ef2583618b397e1824b4 (diff) | |
procsub in work now
Diffstat (limited to 'src/exec.c')
| -rw-r--r-- | src/exec.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -5,6 +5,7 @@ #include <sys/wait.h> #include "syntax.h" +#include "utils.h" void execute_command_pipeline(Pipeline pipeline, int stdin_fd, int stdout_fd); @@ -73,6 +74,8 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd) { close(ps_pipe_fds[1]); char pname[64]; snprintf(pname, sizeof(pname), "/dev/fd/%d", ps_pipe_fds[0]); + push_to_IntVec(&parent_open_fds, ps_pipe_fds[0]); + push_to_StrVec(&arg_vec, strdup(pname)); break; default: exit(67); @@ -122,10 +125,6 @@ void execute_command_pipeline(Pipeline pipeline, int stdin_fd, int stdout_fd) { int trunk_fd = stdin_fd; int pgid = -1; - - signal(SIGTTIN, SIG_IGN); - signal(SIGTTOU, SIG_IGN); - for (int i = 0; i < pipeline.count; i++) { PlCommand cmd = *get_from_Pipeline(&pipeline, i); ExecutableCommand exec_cmd = process_pl_command(cmd); @@ -161,5 +160,7 @@ void execute_command_pipeline(Pipeline pipeline, int stdin_fd, int stdout_fd) { } void execute_pipeline_tree(PipelineTree pltree) { + signal(SIGTTIN, SIG_IGN); + signal(SIGTTOU, SIG_IGN); execute_command_pipeline(*pltree.root, STDIN_FILENO, STDOUT_FILENO); } |
