26 *original_stdin = dup(STDIN_FILENO);
27 if (*original_stdin == -1)
32 close(*original_stdin);
35 if (dup2(fd, STDIN_FILENO) == -1)
38 close(*original_stdin);
56 if (dup2(original_stdin, STDIN_FILENO) == -1)
58 close(original_stdin);
int execute_ast(t_ast *node, t_ms_data *data)
execute Abstract Syntax Tree
static int setup_redirection(t_ast *node, int *original_stdin)
int redirect_in(t_ast *node, t_ms_data *data)
int open_file(t_ast *node, char *direction)
open file in the context of redirection