summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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
commit505a87c24cb4e4ae8a3d5410912bcc6633e9e161 (patch)
tree80ac558442ebbce52a72705fed9f32872b3f584f /src
parent202f4f3a9b7818359d89ef2583618b397e1824b4 (diff)
procsub in work now
Diffstat (limited to 'src')
-rw-r--r--src/exec.c9
-rw-r--r--src/lexparse.c5
2 files changed, 7 insertions, 7 deletions
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 <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);
}
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);
}