From 7485dc7153d9ec7f89c95fb2d91a11ad3e81432c Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Wed, 22 Mar 2017 17:36:43 +0100 Subject: [PATCH] ariard's fix #154 and #155 --- 42sh/src/job_control/job_wait.c | 6 ++---- 42sh/src/main/main.c | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/42sh/src/job_control/job_wait.c b/42sh/src/job_control/job_wait.c index b34371d6..5158fbc5 100644 --- a/42sh/src/job_control/job_wait.c +++ b/42sh/src/job_control/job_wait.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/15 11:49:05 by jhalford #+# #+# */ -/* Updated: 2017/03/20 14:31:28 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:29:38 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,9 +28,7 @@ int job_wait(int id) { if ((pid = waitpid(-j->pgid, &status, WUNTRACED)) == -1 && errno != ECHILD) - ft_dprintf(2, "{red}%s: waitpid error errno=%i{eoc}\n", - SHELL_NAME, errno); - DG("wait trigger pid=%i", pid); + SH_ERR("waitpid(): %s", strerror(errno)); if (pid <= 1 || mark_process_status(pid, status) || job_is_stopped(j) || job_is_completed(j)) diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index e65dc3e9..85575246 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ -/* Updated: 2017/03/22 17:25:20 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:35:21 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -47,7 +47,7 @@ static int handle_instruction(t_list **token, t_btree **ast) if ((ret = do_parser_routine(token, ast)) == 1 && SH_NO_INTERACTIVE(data->opts)) return (ret); - else if (ret == 2) + else if (ret > 0) break ; } if (data->parser.state == SUCCESS && ft_exec(ast) < 0)