fix: file verif cause non close fd

This commit is contained in:
Camille Chauvet 2023-03-30 13:27:23 +02:00
parent bb00de527a
commit cdfa81328b

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 17:36:11 by cchauvet #+# #+# */
/* Updated: 2023/02/15 17:41:13 by cchauvet ### ########.fr */
/* Updated: 2023/03/30 13:26:31 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -54,7 +54,8 @@ int ft_file_is_writable(t_data *data, const char *path)
ft_eprintf("minishell: %s: Permission denied\n", path);
return (0);
}
return (fd);
close(fd);
return (1);
}
int ft_file_is_appendable(t_data *data, const char *path)
@ -76,5 +77,6 @@ int ft_file_is_appendable(t_data *data, const char *path)
ft_eprintf("minishell: %s: Permission denied\n", path);
return (0);
}
return (fd);
close(fd);
return (1);
}