c'est encore cassé mais un peut moins

This commit is contained in:
2024-04-13 13:22:20 +02:00
parent 51fff7aefd
commit 90e569f231
7 changed files with 61 additions and 26 deletions

24
srcs/is_fd_open.c Normal file
View File

@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* is_fd_open.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 17:31:53 by marde-vr #+# #+# */
/* Updated: 2024/03/05 17:35:39 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
#include "../srcs/minishell.h"
int is_fd_open(int fd)
{
if (fcntl(fd, F_GETFL) == -1)
{
ft_printf_fd(2, "%d:closed\n", fd);
return (0);
}
ft_printf_fd(2, "%d:open\n", fd);
return (1);
}