il ne faut pas rouvrir le file descriptor, le man precise quil reste ouvert apres un exec, mais il etait seulement en read, pourtant il y a toujours une erreur, ce nest plus la meme

This commit is contained in:
hugogogo
2021-10-20 00:33:41 +02:00
parent f2c8898fcc
commit f8c23f85b4
2 changed files with 2 additions and 3 deletions

View File

@@ -30,8 +30,7 @@ void exec_cmd(char **envp, t_list *cmd_list)
{
if (cmd->fd_in != 0)
close(cmd->fd_in);
// if (cmd->fd_out != 1 && cmd->fd_redirect == 1)
if (cmd->fd_out != 1)
if (cmd->fd_out != 1 && cmd->fd_redirect == 1)
close(cmd->fd_out);
}
while ((wpid = wait(&status)) > 0);