diff --git a/.clangd b/.clangd index c0df9df9..d81e418c 100644 --- a/.clangd +++ b/.clangd @@ -36,6 +36,16 @@ CompileFlags: # Tweak the parse settings - "-I/home/maix/school/shcat/output/include/" - "-I/home/maix/school/shcat/generic_sources/header/" - "-I/home/maix/school/shcat/exec/src/arith/" + - "-I/home/maix/shcat/vendor/" + - "-I/home/maix/shcat/stdme/include/" + - "-I/home/maix/shcat/allocator/include/" + - "-I/home/maix/shcat/stdme/vendor/" + - "-I/home/maix/shcat/stdme/output/include/" + - "-I/home/maix/shcat/stdme/generic_sources/header/" + - "-I/home/maix/shcat/includes/" + - "-I/home/maix/shcat/output/include/" + - "-I/home/maix/shcat/generic_sources/header/" + - "-I/home/maix/shcat/exec/src/arith/" - "-I/home/raphael/42/shcat/vendor/" - "-I/home/raphael/42/shcat/stdme/include/" - "-I/home/raphael/42/shcat/allocator/include/" diff --git a/exec/src/run_ast.c b/exec/src/run_ast.c index 9c2c3759..64aaf166 100644 --- a/exec/src/run_ast.c +++ b/exec/src/run_ast.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/11 17:22:29 by maiboyer #+# #+# */ -/* Updated: 2024/09/02 13:44:31 by maiboyer ### ########.fr */ +/* Updated: 2024/09/11 18:34:27 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,6 +29,7 @@ #include "me/vec/vec_pid.h" #include "me/vec/vec_str.h" #include "unistd.h" +#include #include #include @@ -852,8 +853,9 @@ t_error run_pipeline(t_ast_pipeline *pipeline, t_state *state, t_pipeline_result } if (pids.len != 0) { - while (waitpid(pids.buffer[pids.len - 1], &waitpid_status, 0) < 0) - ; + if (!(kill(pids.buffer[pids.len - 1], 0) == -1 && errno == ESRCH)) + while (waitpid(pids.buffer[pids.len - 1], &waitpid_status, 0) < 0) + ; while (waitpid(-1, NULL, 0) != -1) ; if (WIFEXITED(waitpid_status)) diff --git a/sources/_helper_main.c b/sources/_helper_main.c index bed270cc..0bb8b77f 100644 --- a/sources/_helper_main.c +++ b/sources/_helper_main.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/06 16:31:41 by rparodi #+# #+# */ -/* Updated: 2024/09/11 16:39:09 by maiboyer ### ########.fr */ +/* Updated: 2024/09/11 18:29:04 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -59,7 +59,7 @@ void exec_shcat(t_state *state) t_program_result prog_res; prog_res = (t_program_result){.exit = 0}; - print_node_data(&state->current_node, 0); + //print_node_data(&state->current_node, 0); free_node(state->current_node); if (state->ast != NULL && run_program(\ &state->ast->data.program, state, &prog_res))