|
|
@ -6,7 +6,7 @@ |
|
|
|
/* By: mea <mea@student.42.fr> +#+ +:+ +#+ */ |
|
|
|
/* +#+#+#+#+#+ +#+ */ |
|
|
|
/* Created: 2022/05/03 11:48:16 by narnaud #+# #+# */ |
|
|
|
/* Updated: 2022/05/17 15:45:59 by mea ### ########.fr */ |
|
|
|
/* Updated: 2022/05/17 16:28:32 by narnaud ### ########.fr */ |
|
|
|
/* */ |
|
|
|
/* ************************************************************************** */ |
|
|
|
|
|
|
@ -117,9 +117,10 @@ int caller(t_datas *datas, t_command *cmd) |
|
|
|
close(cmd->fd[1]); |
|
|
|
if (cmd->ope == PIPE) |
|
|
|
caller(datas, cmd->next); |
|
|
|
else |
|
|
|
waitpid(cmd->pid, &status, 0); |
|
|
|
if (cmd->ope != PIPE) |
|
|
|
{ |
|
|
|
if (!is_builtin(cmd->argv[0]) && waitpid(cmd->pid, &status, 0)) |
|
|
|
if (!is_builtin(cmd->argv[0])) |
|
|
|
datas->exit_code = handle_status(datas, status); |
|
|
|
while (cmd->next && !((cmd->ope == AND && !datas->exit_code) \ |
|
|
|
|| (cmd->ope == OR && datas->exit_code))) |
|
|
|