merge conflicts
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/11/16 01:57:38 by lperrey #+# #+# */
|
||||
/* Updated: 2021/12/01 17:16:55 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/12/05 16:20:55 by lperrey ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -48,7 +48,7 @@ int cmd_find_access(t_cmd *cmd, char *path[])
|
||||
if (!cmd->path)
|
||||
{
|
||||
cmd->error = EXIT_CMD_NOT_FOUND;
|
||||
shell_error(cmd->argv[0], ": command not found");
|
||||
shell_error(cmd->argv[0], ": ", "command not found", 0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
|
||||
@@ -45,7 +45,7 @@ static int open_pipes(t_cmd *pipeline[])
|
||||
else
|
||||
if (close(pipes[STDOUT_FILENO]) == -1)
|
||||
perror("close()");
|
||||
if (pipeline[i]->fd_in == STDIN_FILENO)
|
||||
if (pipeline[i + 1]->fd_in == STDIN_FILENO)
|
||||
pipeline[i + 1]->fd_in = pipes[STDIN_FILENO];
|
||||
else
|
||||
if (close(pipes[STDIN_FILENO]) == -1)
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
|
||||
int cmd_exec_in_subshell(t_cmd *cmd, t_all *c)
|
||||
{
|
||||
struct sigaction signal_behaviour;
|
||||
|
||||
cmd->pid = fork();
|
||||
if (cmd->pid == -1)
|
||||
perror("fork()");
|
||||
if (cmd->pid == 0)
|
||||
{
|
||||
c->signal_behaviour.sa_handler = SIG_DFL;
|
||||
sigaction(SIGINT, &c->signal_behaviour, NULL);
|
||||
ft_bzero(&signal_behaviour, sizeof signal_behaviour);
|
||||
signal_behaviour.sa_handler = SIG_DFL;
|
||||
sigaction(SIGINT, &signal_behaviour, NULL);
|
||||
sigaction(SIGQUIT, &signal_behaviour, NULL);
|
||||
if (cmd->fd_in != STDIN_FILENO)
|
||||
if (dup2(cmd->fd_in, STDIN_FILENO) == -1)
|
||||
return (ft_reti_perror(EXIT_FAILURE, "dup2()"));
|
||||
|
||||
Reference in New Issue
Block a user