From d907f70af6629da902fc0ab77180bb560d0d2c65 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Thu, 21 May 2026 01:57:06 +0200 Subject: work on redesign debugging --- redes/exec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'redes/exec.c') 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 #include #include @@ -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); } -- cgit v1.2.3