c'est encore cassé mais un peut moins
This commit is contained in:
24
srcs/is_fd_open.c
Normal file
24
srcs/is_fd_open.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user