This commit is contained in:
Camille Chauvet
2023-03-13 14:23:27 +01:00
parent c43331dca3
commit 4d3c25547e
12 changed files with 174 additions and 317 deletions

View File

@ -51,12 +51,12 @@ static bool ft_executor(t_cmd *cmd, char **env)
return (1);
if (cmd->pid == 0)
{
dup2(cmd->fd_in[0], 0);
dup2(cmd->fd_out[0], 1);
if (cmd->fd_in[1] != -1)
dup2(cmd->fd_in[1], 0);
if (cmd->fd_out[1] != -1)
dup2(cmd->fd_out[1], 1);
dup2(cmd->fd_in[0], 0);
dup2(cmd->fd_out[0], 1);
ft_closer(cmd->fd_in);
ft_closer(cmd->fd_out);
execve(cmd->executable, cmd->args, env);