diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-30 18:48:54 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-30 18:48:54 +0200 |
commit | f68a88318934a2373b0c73aeecebca38ef3881be (patch) | |
tree | 0122fdddb3cb0649d0a2ed6d271b1f2a464ab417 | |
parent | Renamed quite some stuff (diff) | |
download | 42-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
-rw-r--r-- | src/e_builtins.c | 31 | ||||
-rw-r--r-- | src/e_builtins.h | 8 |
2 files changed, 14 insertions, 25 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; */ } diff --git a/src/e_builtins.h b/src/e_builtins.h index f3492c9..302e795 100644 --- a/src/e_builtins.h +++ b/src/e_builtins.h @@ -10,12 +10,12 @@ /* */ /* ************************************************************************** */ -#ifndef E_BUILTINS_H -#define E_BUILTINS_H +#ifndef FT_E_BUILTINS_H +# define FT_E_BUILTINS_H -#include <stdint.h> +# include <stdint.h> -#include "s_struct.h" +# include "s_struct.h" void e_builtin(const t_com *ptr, uint8_t bu_id, t_msh *msh); |