summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-07 15:30:14 +0200
committerDominik Kaiser2024-05-07 15:30:14 +0200
commitff846486ce845beab8b0fe31c227b5c5ad620bb9 (patch)
tree7baf5d54899e6da59b87c9a9cf1d394863b04e20 /src
parent7af46f10e23296baa72b70e5fbc72eb35e2a9b01 (diff)
downloadpipex-ff846486ce845beab8b0fe31c227b5c5ad620bb9.tar.gz
pipex-ff846486ce845beab8b0fe31c227b5c5ad620bb9.zip
Still restoring
Diffstat (limited to 'src')
-rw-r--r--src/input_handling.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input_handling.c b/src/input_handling.c
index e4bf7d6..ef4cec8 100644
--- a/src/input_handling.c
+++ b/src/input_handling.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 12:13:23 by dkaiser #+# #+# */
-/* Updated: 2024/05/07 15:17:19 by dkaiser ### ########.fr */
+/* Updated: 2024/05/07 15:26:08 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,6 +14,7 @@
#include "pipex.h"
#include <fcntl.h>
#include <stdlib.h>
+#include <sys/_types/_s_ifmt.h>
#include <unistd.h>
static char **get_cmds(int argc, char *argv[], char *envp[])
@@ -50,7 +51,7 @@ t_pxdata *get_pxdata(int argc, char *argv[], char *envp[])
if (!result)
return (NULL); // TODO: Check if an error message needs to be sent
result->in_fd = open(argv[1], O_RDONLY);
- result->out_fd = open(argv[--argc], O_WRONLY | O_CREAT | O_TRUNC);
+ result->out_fd = open(argv[--argc], O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWUSR);
result->cmds = get_cmds(argc, argv, envp);
return (result);
}