summaryrefslogtreecommitdiffstats
path: root/src/ft_e_builtins.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_e_builtins.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/ft_e_builtins.c b/src/ft_e_builtins.c
index 34a8534..b47b0f9 100644
--- a/src/ft_e_builtins.c
+++ b/src/ft_e_builtins.c
@@ -86,24 +86,17 @@ void
{
pid_t pid;
- /* TODO: handle exit | bu_id = 6 */
- if (bu_id != 6)
+ /* TODO: find a way to handle exit | bu_id = 6 */
+ if ((pid = fork()) == 0)
{
- if ((pid = fork()) == 0)
- {
- ft_e_builtin_child(ptr, bu_id, msh);
- }
- else if (pid < 0)
- {
- /* TODO: handle fork failed */
- }
- else
- {
- ft_e_builtin_parent(pid, msh);
- }
+ ft_e_builtin_child(ptr, bu_id, msh);
+ }
+ else if (pid < 0)
+ {
+ /* TODO: handle fork failed */
}
else
{
- msh->ret = msh->bu_ptr[bu_id](ptr->args, msh);
+ ft_e_builtin_parent(pid, msh);
}
}