summaryrefslogtreecommitdiffstats
path: root/src/e_builtins.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-30 18:48:54 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-30 18:48:54 +0200
commitf68a88318934a2373b0c73aeecebca38ef3881be (patch)
tree0122fdddb3cb0649d0a2ed6d271b1f2a464ab417 /src/e_builtins.c
parentRenamed quite some stuff (diff)
download42-minishell-f68a88318934a2373b0c73aeecebca38ef3881be.tar.gz
42-minishell-f68a88318934a2373b0c73aeecebca38ef3881be.tar.bz2
42-minishell-f68a88318934a2373b0c73aeecebca38ef3881be.tar.xz
42-minishell-f68a88318934a2373b0c73aeecebca38ef3881be.tar.zst
42-minishell-f68a88318934a2373b0c73aeecebca38ef3881be.zip
Normed e_builtins
Diffstat (limited to 'src/e_builtins.c')
-rw-r--r--src/e_builtins.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/e_builtins.c b/src/e_builtins.c
index 2f6d33f..bc14ced 100644
--- a/src/e_builtins.c
+++ b/src/e_builtins.c
@@ -27,9 +27,7 @@
#include "s_struct.h"
#include "u_utils.h"
-static void
- e_export_env_fork(const t_com *ptr,
- t_msh *msh)
+static void e_export_env_fork(const t_com *ptr, t_msh *msh)
{
char **re_ptr;
@@ -41,10 +39,7 @@ static void
}
}
-static void
- e_builtin_child(const t_com *ptr,
- uint8_t bu_id,
- t_msh *msh)
+static void e_builtin_child(const t_com *ptr, uint8_t bu_id, t_msh *msh)
{
int32_t ret;
@@ -63,11 +58,10 @@ static void
exit(ret);
}
-static void
- e_builtin_parent(pid_t pid,
- const t_com *ptr,
- uint8_t bu_id,
- t_msh *msh)
+static void e_builtin_parent(pid_t pid,
+ const t_com *ptr,
+ uint8_t bu_id,
+ t_msh *msh)
{
int32_t status;
int32_t ret;
@@ -95,12 +89,8 @@ static void
}
}
-void
- e_builtin(const t_com *ptr,
- uint8_t bu_id,
- t_msh *msh)
+void e_builtin(const t_com *ptr, uint8_t bu_id, t_msh *msh)
{
- /* int32_t ret; */
pid_t pid;
if ((pid = fork()) == 0)
@@ -109,13 +99,12 @@ void
}
else if (pid < 0)
{
- /* TODO: handle fork() failed */
+ /*
+ ** TODO: handle fork() failed
+ */
}
else
{
e_builtin_parent(pid, ptr, bu_id, msh);
}
- /* dup_redirs(ptr, msh); */
- /* ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); */
- /* msh->ret = ret; */
}