fix: put old exit code to ft_exit
This commit is contained in:
parent
b3e9a23f32
commit
5cbb6f078d
@ -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/03/31 16:32:38 by alouis-j ### ########.fr */
|
/* Updated: 2023/04/05 12:18:52 by alouis-j ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ static int ft_execute_own_cmd(t_data *data, t_cmd *cmd)
|
|||||||
return_code = (echo(cmd->fd_out[0], cmd->args + 1));
|
return_code = (echo(cmd->fd_out[0], cmd->args + 1));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return_code = ft_exit(cmd->args + 1);
|
return_code = ft_exit(cmd->args + 1, data->exit_code);
|
||||||
if (return_code >= 0)
|
if (return_code >= 0)
|
||||||
{
|
{
|
||||||
data->exit_code = return_code;
|
data->exit_code = return_code;
|
||||||
|
Loading…
Reference in New Issue
Block a user