summaryrefslogtreecommitdiffstats
path: root/src/ft_m_redirs.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 15:41:44 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 15:41:44 +0200
commitf8bb8b120e6d8a207d1e34d139ecbb30653f36d6 (patch)
treefa9827b6f179035328fabfafee1e014ba31195a3 /src/ft_m_redirs.c
parentstrerror is nice actually (diff)
download42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.gz
42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.bz2
42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.xz
42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.zst
42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.zip
Nice redirs
Diffstat (limited to '')
-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);
}
}