From 35a03072ee8b88c7a6c57e2af6824c26ad49410a Mon Sep 17 00:00:00 2001 From: Joppe Boeve Date: Fri, 22 Dec 2023 14:58:09 +0100 Subject: [PATCH] Add check in redirecitons --- src/execute/pipeline.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/execute/pipeline.c b/src/execute/pipeline.c index 21cbac6..c87ec40 100644 --- a/src/execute/pipeline.c +++ b/src/execute/pipeline.c @@ -6,7 +6,7 @@ /* By: ivan-mel +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/05 02:54:41 by joppe #+# #+# */ -/* Updated: 2023/12/22 13:00:45 by jboeve ######## odam.nl */ +/* Updated: 2023/12/22 14:56:46 by jboeve ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -69,8 +69,10 @@ static int child_proc(t_meta *meta, t_cmd_list *cmd, t_hd_list **heredocs) close(cmd->pipe[PIPE_WRITE]); } set_signal_mode(CHILD); - redirections(&cmd->content, heredocs); - status = run_command(meta, &cmd->content); + if (!redirections(&cmd->content, heredocs)) + status = 1; + else + status = run_command(meta, &cmd->content); if (status) perror("megashell"); return (status);