CO-CODE Hugo-Luke

+ signals handling adjusted
+ wait_subshell() with last_exit_status
+ miscs
This commit is contained in:
LuckyLaszlo
2021-11-17 01:35:06 +01:00
parent 965cf99ca5
commit 26993144cc
8 changed files with 185 additions and 128 deletions

View File

@@ -73,7 +73,7 @@ int fill_builtin(t_cmd *cmd, int (*builtin)(int, char **, t_all *))
}
int handle_builtin(t_cmd *cmd)
{
{ // Il faut penser à comparer un char de plus (\0 inclus)
if (!ft_strncmp(cmd->argv[0], "echo", 4))
return (fill_builtin(cmd, &builtin_echo));
// else if (!ft_strncmp(cmd->argv[0], "cd", 2))
@@ -133,7 +133,7 @@ void fd_redirection(t_token *token, t_cmd *cmd)
if (token->id == T_LESS) // '<'
{
flag = O_RDONLY | O_CREAT;
flag = O_RDONLY | O_CREAT; // O_CREAT ? Pourquoi donc ?
if (cmd->fd_in != 0)
close(cmd->fd_in);
cmd->fd_in = open(token->next->content, flag);