Skip to content

Commit

Permalink
Fix ubuntu things
Browse files Browse the repository at this point in the history
  • Loading branch information
arzelcm committed Jun 14, 2024
1 parent cf1b984 commit 514b7fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/executor/executor_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "utils.h"
#include "pdata_helpers.h"
#include <errno.h>
#include <sys/wait.h>

int wait_child_processes(pid_t last_pid, int cmds_amount)
{
Expand Down
1 change: 1 addition & 0 deletions src/executor/open_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <signal.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>

static void wait_here_doc_process(int fds[2])
{
Expand Down
1 change: 1 addition & 0 deletions src/executor/pdata_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "safe_utils.h"
#include "utils.h"
#include <errno.h>
#include <signal.h>

void free_pdata(t_pdata *p_data)
{
Expand Down
12 changes: 6 additions & 6 deletions src/signals/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 514b7fb

Please sign in to comment.