refactoring exec

This commit is contained in:
LuckyLaszlo
2021-12-01 17:24:32 +01:00
parent b08da252de
commit b3f74c4179
9 changed files with 60 additions and 27 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/16 01:57:38 by lperrey #+# #+# */
/* Updated: 2021/11/27 11:07:19 by lperrey ### ########.fr */
/* Updated: 2021/12/01 16:49:37 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -37,7 +37,7 @@ int simple_command_builtin(t_cmd *cmd, t_all *c)
if (dup2(cmd->fd_out, STDOUT_FILENO) == -1)
return (ft_reti_perror(EXIT_FAILURE, "dup2()"));
}
set_last_exit_status(cmd->builtin_func(ft_2d_arrlen(cmd->argv), cmd->argv, c));
set_last_exit_status(cmd->builtin_f(ft_2d_arrlen(cmd->argv), cmd->argv, c));
if (!restore_stdio(stdin_dup, stdout_dup))
return (EXIT_FAILURE);
return (EXIT_SUCCESS);