can't figure out why it returns wrong value
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
|
||||
/* Updated: 2024/03/05 19:19:33 by marde-vr ### ########.fr */
|
||||
/* Updated: 2024/03/24 09:56:01 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -35,10 +35,11 @@ void open_input_file(t_msh *msh, t_cmd **cur_cmd)
|
||||
{
|
||||
if (msh->in_fd != 0)
|
||||
close(msh->in_fd);
|
||||
msh->in_fd = open((*cur_cmd)->next->token, O_RDONLY | O_CREAT);
|
||||
msh->in_fd = open((*cur_cmd)->next->token, O_RDONLY);
|
||||
if (msh->in_fd == -1 && !g_return_code)
|
||||
{
|
||||
ft_printf_fd(2, "minishell: %s: ", (*cur_cmd)->next->token);
|
||||
//ft_printf_fd(2, "\nset return_code to 1\n");
|
||||
perror("");
|
||||
g_return_code = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user