diff options
| author | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 09:51:42 +0200 |
|---|---|---|
| committer | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-21 09:51:42 +0200 |
| commit | de11428a45eb36dfa1c39fc59b56d0273fbec4a0 (patch) | |
| tree | 48e13974c493b6f00e3c551fff1cbd6977d1dfc4 /redes/exec.c | |
| parent | ed02ec0d1628b4eaf56e751b29532426ef229b89 (diff) | |
got new flow working(?)
Diffstat (limited to 'redes/exec.c')
| -rw-r--r-- | redes/exec.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/redes/exec.c b/redes/exec.c index 964b0a0..8fb42b8 100644 --- a/redes/exec.c +++ b/redes/exec.c @@ -1,13 +1,17 @@ #include <stdio.h> #include <unistd.h> #include <fcntl.h> +#include <signal.h> +#include <sys/wait.h> #include "syntax.h" void execute_cmd(ExecutableCommand cmd, int* pgid) { - printf("ok\n"); + printf("Ok\n"); + fflush(stdout); + pid_t pid = fork(); if (pid == 0) { @@ -100,9 +104,15 @@ void execute_command_pipeline(Pipeline pipeline) { int trunk_fd = STDIN_FILENO; int pgid = -1; - size_t i = 0; + printf("Starting pipeline of length %d\n", pipeline.count); + fflush(stdout); + + signal(SIGTTIN, SIG_IGN); + signal(SIGTTOU, SIG_IGN); for (int i = 0; i < pipeline.count; i++) { + printf("Processing cmd %d\n", i); + fflush(stdout); PlCommand cmd = *get_from_Pipeline(&pipeline, i); ExecutableCommand exec_cmd = process_pl_command(cmd); exec_cmd.stdin_fd = trunk_fd; @@ -130,7 +140,7 @@ void execute_command_pipeline(Pipeline pipeline) { } void execute_pipeline_tree(PipelineTree pltree) { - printf("Hello"); + printf("Hello\n"); fflush(stdout); execute_command_pipeline(*pltree.root); } |
