diff options
| author | Christopher Uhlig | 2025-01-20 17:34:02 +0100 |
|---|---|---|
| committer | Christopher Uhlig | 2025-01-20 17:34:02 +0100 |
| commit | 634a3b84b31cbcc5c0c665338e1ef1eb49f25e5d (patch) | |
| tree | a30f4d0c47a636c822e97efc2678b61d3e2c3dad /src/handle_redir.c | |
| parent | 8f5abcdb257393a2e576fe382835e8e060662834 (diff) | |
| download | minishell-634a3b84b31cbcc5c0c665338e1ef1eb49f25e5d.tar.gz minishell-634a3b84b31cbcc5c0c665338e1ef1eb49f25e5d.zip | |
fixed a bunch of stuff
Diffstat (limited to 'src/handle_redir.c')
| -rw-r--r-- | src/handle_redir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/handle_redir.c b/src/handle_redir.c index 29bba92..e8a1010 100644 --- a/src/handle_redir.c +++ b/src/handle_redir.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/01/18 18:34:51 by chuhlig #+# #+# */ -/* Updated: 2025/01/18 18:47:31 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 14:59:38 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,7 @@ int handle_input_redirection(t_redirection *redir) } else if (redir->type == INPUT_LIMITER) { - fd = open_file("/tmp/heredoc_tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644); + fd = open_file("/tmp/heredoc_tmp", O_WRONLY | O_TRUNC, 0644); if (fd < 0) return (-1); write(fd, redir->specifier, ft_strlen(redir->specifier)); @@ -46,7 +46,7 @@ int handle_output_redirection(t_redirection *redir) if (redir->type == OUTPUT_OVERRIDE) { - fd = open_file(redir->specifier, O_WRONLY | O_CREAT | O_TRUNC, 0644); + fd = open_file(redir->specifier, O_WRONLY | O_TRUNC, 0644); if (fd < 0) return (-1); dup2(fd, STDOUT_FILENO); @@ -54,7 +54,7 @@ int handle_output_redirection(t_redirection *redir) } else if (redir->type == OUTPUT_APPEND) { - fd = open_file(redir->specifier, O_WRONLY | O_CREAT | O_APPEND, 0644); + fd = open_file(redir->specifier, O_WRONLY | O_APPEND, 0644); if (fd < 0) return (-1); dup2(fd, STDOUT_FILENO); |
