From 514b7fbea234fed873afdc7ef40b87a5e8123407 Mon Sep 17 00:00:00 2001 From: arzelcm Date: Fri, 14 Jun 2024 10:40:55 +0000 Subject: [PATCH] Fix ubuntu things --- src/executor/executor_utils.c | 1 + src/executor/open_utils.c | 1 + src/executor/pdata_helpers.c | 1 + src/signals/signals.c | 12 ++++++------ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/executor/executor_utils.c b/src/executor/executor_utils.c index 4ea0812..cefbcbb 100644 --- a/src/executor/executor_utils.c +++ b/src/executor/executor_utils.c @@ -4,6 +4,7 @@ #include "utils.h" #include "pdata_helpers.h" #include +#include int wait_child_processes(pid_t last_pid, int cmds_amount) { diff --git a/src/executor/open_utils.c b/src/executor/open_utils.c index 6fbba12..58cc91d 100644 --- a/src/executor/open_utils.c +++ b/src/executor/open_utils.c @@ -7,6 +7,7 @@ #include #include #include +#include static void wait_here_doc_process(int fds[2]) { diff --git a/src/executor/pdata_helpers.c b/src/executor/pdata_helpers.c index d5ec649..c3778bb 100644 --- a/src/executor/pdata_helpers.c +++ b/src/executor/pdata_helpers.c @@ -4,6 +4,7 @@ #include "safe_utils.h" #include "utils.h" #include +#include void free_pdata(t_pdata *p_data) { diff --git a/src/signals/signals.c b/src/signals/signals.c index b3da55e..3e62d18 100644 --- a/src/signals/signals.c +++ b/src/signals/signals.c @@ -36,18 +36,18 @@ void listen_signals(int sigquit_mode, int sigint_mode) sa.sa_flags = SA_RESTART; sigemptyset(&sa.sa_mask); if (sigquit_mode == MAIN || sigquit_mode == HEREDOC) - sa.__sigaction_u.__sa_handler = SIG_IGN; + sa.sa_handler = SIG_IGN; else if (sigquit_mode == SUBPROCESS) - sa.__sigaction_u.__sa_handler = SIG_DFL; + sa.sa_handler = SIG_DFL; sigaction(SIGQUIT, &sa, NULL); if (sigint_mode == MAIN) - sa.__sigaction_u.__sa_handler = catch_sigint_prompt; + sa.sa_handler = catch_sigint_prompt; else if (sigint_mode == SUBPROCESS) - sa.__sigaction_u.__sa_handler = SIG_DFL; + sa.sa_handler = SIG_DFL; else if (sigint_mode == EXECUTOR) - sa.__sigaction_u.__sa_handler = SIG_IGN; + sa.sa_handler = SIG_IGN; else if (sigint_mode == HEREDOC) - sa.__sigaction_u.__sa_handler = catch_sigint_heredoc; + sa.sa_handler = catch_sigint_heredoc; sigaction(SIGINT, &sa, NULL); }