fix: no exit when ft_exit return -2

This commit is contained in:
Camille Chauvet 2023-04-05 12:32:34 +02:00
parent 8a245f0dd8
commit fe535a21f0

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */ /* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */
/* Updated: 2023/04/05 12:18:52 by alouis-j ### ########.fr */ /* Updated: 2023/04/05 12:30:09 by alouis-j ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -34,7 +34,7 @@ static int ft_execute_own_cmd(t_data *data, t_cmd *cmd)
if (return_code >= 0) if (return_code >= 0)
{ {
data->exit_code = return_code; data->exit_code = return_code;
return (-1); return (-2);
} }
} }
data->exit_code = return_code; data->exit_code = return_code;
@ -70,7 +70,7 @@ static int ft_cmd_executor(t_data *data, t_cmd *cmd)
exit_code = ft_execute_own_cmd(data, cmd); exit_code = ft_execute_own_cmd(data, cmd);
ft_closer(cmd->fd_in); ft_closer(cmd->fd_in);
ft_closer(cmd->fd_out); ft_closer(cmd->fd_out);
if (exit_code == -1) if (exit_code == -2)
return (1); return (1);
} }
else else