working on fixing pipes

This commit is contained in:
mdev9
2024-04-01 21:39:33 +02:00
parent 7d1fba69a9
commit dc73084ede
12 changed files with 61 additions and 97 deletions

View File

@ -6,13 +6,13 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
/* Updated: 2024/04/01 13:20:54 by marde-vr ### ########.fr */
/* Updated: 2024/04/01 20:08:48 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void redirect_input(t_msh *msh, int i)
void redirect_input(t_msh *msh)
{
if (/*msh->in_type != PIPE*/ 1)
{
@ -22,7 +22,7 @@ void redirect_input(t_msh *msh, int i)
}
else
{
if (dup2(msh->fds[i - 1][0], 0) < 0)
if (dup2(msh->in_fd, 0) < 0)
ft_exit(msh, 1);
}
}