fix: all fds is now in childreen

This commit is contained in:
Camille Chauvet
2023-03-31 16:36:15 +02:00
parent d9ae113b94
commit a7e75bb163
5 changed files with 26 additions and 16 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/17 15:36:26 by cchauvet #+# #+# */
/* Updated: 2023/03/31 15:31:58 by alouis-j ### ########.fr */
/* Updated: 2023/03/31 16:19:48 by alouis-j ### ########.fr */
/* */
/* ************************************************************************** */
@ -73,12 +73,14 @@ int ft_heredoc(t_data *data, char *stop)
break ;
else if (return_code)
{
close(*ft_get_heredoc())
*ft_get_heredoc() = -1;
close(*ft_get_heredoc());
return (-2);
}
}
close(*ft_get_heredoc())
close(fds[1]);
close(*ft_get_heredoc());
*ft_get_heredoc() = -1;
*ft_get_heredoc() = -1;
close(fds[1]);
return (fds[0]);
}