can't figure out why it returns wrong value

This commit is contained in:
mdev9
2024-03-24 10:00:09 +01:00
parent bedf72b553
commit a58366f827
8 changed files with 28 additions and 194 deletions

View File

@ -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;
}