From a94de38d1d4dc2c510388e2ab4e07bfc29b3855d Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 23 Apr 2020 14:00:33 +0200 Subject: WHY YOU EXIT --- src/ft_e_lcom.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ft_e_lcom.c') diff --git a/src/ft_e_lcom.c b/src/ft_e_lcom.c index 3468954..61b9cd7 100644 --- a/src/ft_e_lcom.c +++ b/src/ft_e_lcom.c @@ -17,6 +17,8 @@ #include #include #include +#include "ft_s_destroy.h" +#include "ft_s_lcom.h" #include "ft_s_struct.h" static uint8_t @@ -41,6 +43,7 @@ uint8_t t_lcom *ptr; int32_t fd; int32_t status; + int32_t ret; uint8_t bu_id; pid_t pid; @@ -52,7 +55,6 @@ uint8_t { if ((pid = fork()) == 0) { - ft_printf("[%hhd] [%s]\n", ptr->redir, ptr->rdrpath); if (ptr->redir == 1) { if ((fd = open(ptr->rdrpath, @@ -74,7 +76,10 @@ uint8_t close(fd); } msh->ret = msh->bu_ptr[bu_id](ptr->args, msh); - exit(msh->ret); + ret = msh->ret; + ft_lcom_clear(&msh->curr); + ft_s_destroy(msh); + exit(ret); } else if (pid < 0) { -- cgit v1.2.3