From f8bb8b120e6d8a207d1e34d139ecbb30653f36d6 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 25 Apr 2020 15:41:44 +0200 Subject: Nice redirs --- src/ft_m_redirs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ft_m_redirs.c') diff --git a/src/ft_m_redirs.c b/src/ft_m_redirs.c index e601894..bdb5b21 100644 --- a/src/ft_m_redirs.c +++ b/src/ft_m_redirs.c @@ -37,7 +37,7 @@ void if ((fd = open(ptr->rdrpath, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1) ft_f_redir(ptr->rdrpath, msh); - dup2(fd, STDOUT_FILENO); + dup2(fd, ptr->rdrfd); close(fd); } if (ptr->redir == 2) @@ -45,7 +45,7 @@ void if ((fd = open(ptr->rdrpath, O_CREAT | O_APPEND | O_WRONLY, 0644)) == -1) ft_f_redir(ptr->rdrpath, msh); - dup2(fd, STDOUT_FILENO); + dup2(fd, ptr->rdrfd); close(fd); } } -- cgit v1.2.3