summaryrefslogtreecommitdiffstats
path: root/src/ft_m_redirs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_m_redirs.c')
-rw-r--r--src/ft_m_redirs.c4
1 files changed, 2 insertions, 2 deletions
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);
}
}