display exit status of the last command

This commit is contained in:
whaffman 2025-02-09 16:04:57 +01:00
parent f4bf733040
commit 6f21f11429

View File

@ -6,7 +6,7 @@
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/05 16:21:39 by whaffman #+# #+# */ /* Created: 2025/02/05 16:21:39 by whaffman #+# #+# */
/* Updated: 2025/02/08 19:24:05 by willem ######## odam.nl */ /* Updated: 2025/02/09 11:17:51 by willem ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -74,7 +74,9 @@ void fork_execve(t_minishell *minishell, char *path, char **argv)
else else
{ {
free(path); free(path);
ft_free_arr(argv);
waitpid(pid, &status, 0); waitpid(pid, &status, 0);
printf("exit status of pid(%d): %d\n", pid, (((status) & 0xff00) >> 8));
} }
} }