diff options
| author | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 01:57:06 +0200 |
|---|---|---|
| committer | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 01:57:06 +0200 |
| commit | d907f70af6629da902fc0ab77180bb560d0d2c65 (patch) | |
| tree | 6a99a298926fb398ad45155d2ab235dcad169e4d /redes/exec.c | |
| parent | a5a26f986b6d34269c17f45a98625979da3b7136 (diff) | |
work on redesign debugging
Diffstat (limited to 'redes/exec.c')
| -rw-r--r-- | redes/exec.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/redes/exec.c b/redes/exec.c index 437dfbe..964b0a0 100644 --- a/redes/exec.c +++ b/redes/exec.c @@ -1,3 +1,4 @@ +#include <stdio.h> #include <unistd.h> #include <fcntl.h> @@ -5,11 +6,12 @@ void execute_cmd(ExecutableCommand cmd, int* pgid) { - + + printf("ok\n"); pid_t pid = fork(); if (pid == 0) { - + if (*pgid == -1) { setpgid(0, 0); } else { @@ -19,7 +21,7 @@ void execute_cmd(ExecutableCommand cmd, int* pgid) { dup2(cmd.stdin_fd, STDIN_FILENO); dup2(cmd.stdout_fd, STDOUT_FILENO); - for (int i = 0; i < cmd.open_fds.count; i++) { + for (int i = 0; i < cmd.redirects.count; i++) { FdRedirect fd_rd = *get_from_FdRedirectVec(&cmd.redirects, i); dup2(fd_rd.to, fd_rd.redirected); } @@ -128,5 +130,7 @@ void execute_command_pipeline(Pipeline pipeline) { } void execute_pipeline_tree(PipelineTree pltree) { + printf("Hello"); + fflush(stdout); execute_command_pipeline(*pltree.root); } |
