From 505a87c24cb4e4ae8a3d5410912bcc6633e9e161 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Thu, 21 May 2026 14:55:38 +0200 Subject: procsub in work now --- src/exec.c | 9 +++++---- src/lexparse.c | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/exec.c b/src/exec.c index 1da1f25..4a35142 100644 --- a/src/exec.c +++ b/src/exec.c @@ -5,6 +5,7 @@ #include #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); } diff --git a/src/lexparse.c b/src/lexparse.c index 3a55b33..e2315fe 100644 --- a/src/lexparse.c +++ b/src/lexparse.c @@ -215,9 +215,8 @@ TokenVec* lex_level(char* line, size_t* pos, char until, TokenVecVec* tok_seq_po push_to_TokenVec(&tokens, m_last.value); } - if (until == '\0') { - push_to_TokenVec(&tokens, (Token){.kind = TOK_SPEC, .as.spec = (SpecialToken){.kind = SPEC_OP, .as.op = OP_EOL}}); - } + push_to_TokenVec(&tokens, (Token){.kind = TOK_SPEC, .as.spec = (SpecialToken){.kind = SPEC_OP, .as.op = OP_EOL}}); + return push_to_TokenVecVec(tok_seq_pool, tokens); } -- cgit v1.2.3