summaryrefslogtreecommitdiffstats
path: root/src/ft_b_exit.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-28 15:49:58 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-28 15:49:58 +0200
commit86b25977265727217ec3360c3dc19b74f2bd448f (patch)
treeeefc1440e2ae18faaab0e5409dac58bfef893813 /src/ft_b_exit.c
parentNice functional cd (diff)
download42-minishell-86b25977265727217ec3360c3dc19b74f2bd448f.tar.gz
42-minishell-86b25977265727217ec3360c3dc19b74f2bd448f.tar.bz2
42-minishell-86b25977265727217ec3360c3dc19b74f2bd448f.tar.xz
42-minishell-86b25977265727217ec3360c3dc19b74f2bd448f.tar.zst
42-minishell-86b25977265727217ec3360c3dc19b74f2bd448f.zip
exit is fine
Diffstat (limited to '')
-rw-r--r--src/ft_b_exit.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ft_b_exit.c b/src/ft_b_exit.c
index ae421cf..7a7e5e8 100644
--- a/src/ft_b_exit.c
+++ b/src/ft_b_exit.c
@@ -13,6 +13,8 @@
#include <libft.h>
#include <stdlib.h>
#include <stdint.h>
+#include <unistd.h>
+
#include "ft_f_fail.h"
#include "ft_s_lcom.h"
#include "ft_s_destroy.h"
@@ -36,13 +38,6 @@ uint8_t
ret = ft_atoi(args[0]);
/* TODO: non numeric args[0] */
}
- else
- {
- ret = msh->ret;
- }
- ft_lcom_clear(&msh->curr);
- ft_s_destroy(msh);
- ft_printf("exit\n");
- exit(ret);
+ ft_dprintf(STDERR_FILENO, "exit\n");
return (0);
}