free instant process

This commit is contained in:
wescande 2017-03-20 18:58:27 +01:00
parent 71f990edbe
commit f4a451a802
4 changed files with 9 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 02:26:31 by wescande #+# #+# */
/* Updated: 2017/03/20 15:49:52 by gwojda ### ########.fr */
/* Updated: 2017/03/20 18:45:11 by wescande ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,5 +15,6 @@
int pfree_cond(t_process *p)
{
btree_del(&p->data.d_while.content, &ast_free);
btree_del(&p->data.d_while.condition, &ast_free);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
/* Updated: 2017/03/20 15:58:12 by gwojda ### ########.fr */
/* Updated: 2017/03/20 18:41:25 by wescande ### ########.fr */
/* */
/* ************************************************************************** */
@ -58,6 +58,7 @@ int process_launch(t_process *p)
if (!(pid = do_the_fork_if_i_have_to(p)))
{
process_resetfds(p);
process_free(p, 0);
return (1);
}
p->pid = pid;

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/05 14:54:45 by jhalford #+# #+# */
/* Updated: 2017/03/20 17:07:01 by gwojda ### ########.fr */
/* Updated: 2017/03/20 18:50:44 by wescande ### ########.fr */
/* */
/* ************************************************************************** */
@ -50,6 +50,7 @@ int process_set(t_process *p, t_btree *ast)
int op;
int fds[2];
ft_bzero(p, sizeof(t_process));
exec = &data_singleton()->exec;
op = pop(&exec->op_stack);
if ((EXEC_IS_AND_IF(exec->attrs)

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 12:41:11 by jhalford #+# #+# */
/* Updated: 2017/03/20 12:55:37 by jhalford ### ########.fr */
/* Updated: 2017/03/20 18:58:03 by wescande ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,5 +21,6 @@ void process_free(void *content, size_t content_size)
if (p->map.free)
(p->map.free)(p);
ft_lstdel(&p->redirs, redir_free);
free(p);
if (content_size)
free(p);
}