✏️」 norm: normed

This commit is contained in:
2024-07-15 14:43:03 +02:00
parent 17bb4ce14e
commit bd49fa19a1
2 changed files with 11 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */ /* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */ /* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */
/* Updated: 2024/07/14 20:13:30 by adjoly ### ########.fr */ /* Updated: 2024/07/15 14:35:30 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,6 +15,8 @@
#include "error_msg.h" #include "error_msg.h"
#include "execution.h" #include "execution.h"
void __sig(void);
void exec_cmd(char *cmd, char **argv, char **env, t_env *env_t) void exec_cmd(char *cmd, char **argv, char **env, t_env *env_t)
{ {
int i; int i;
@ -86,8 +88,6 @@ int exec_single_cmd(t_cmd *cmd, char **env, t_env *env_t, int pipe_fd[2])
fork_pid = fork(); fork_pid = fork();
if (!fork_pid) if (!fork_pid)
__fork_single_cmd(cmd, env, env_t, exec); __fork_single_cmd(cmd, env, env_t, exec);
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, SIG_IGN);
return (fork_pid); return (fork_pid);
} }
@ -112,6 +112,7 @@ t_exec exec_pipe(t_exec exec, t_list *list_cmd, t_env *env)
} }
exec.status = exec_single_cmd(list_cmd->content, exec.env_array, \ exec.status = exec_single_cmd(list_cmd->content, exec.env_array, \
env, exec.pipe_fd); env, exec.pipe_fd);
__sig();
if (((t_cmd *)(list_cmd->content))->outfile != STDOUT_FILENO) if (((t_cmd *)(list_cmd->content))->outfile != STDOUT_FILENO)
close(((t_cmd *)(list_cmd->content))->outfile); close(((t_cmd *)(list_cmd->content))->outfile);
if (((t_cmd *)(list_cmd->content))->infile != STDIN_FILENO) if (((t_cmd *)(list_cmd->content))->infile != STDIN_FILENO)

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */ /* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */
/* Updated: 2024/07/09 22:57:38 by adjoly ### ########.fr */ /* Updated: 2024/07/15 14:32:40 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -36,3 +36,9 @@ int send_error_exec(char *input)
free(input); free(input);
return (-1); return (-1);
} }
void __sig(void)
{
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, SIG_IGN);
}