42_minishell/utils/fd.c
2023-03-10 12:32:39 +01:00

18 lines
216 B
C

#include "./utils.h"
void ft_closer(int fds[2])
{
if (fds[0] > 2)
close(fds[0]);
if (fds[1] > 2)
close(fds[1]);
}
void ft_add_fd(int fds[2], int fd)
{
if (fds[0] == -1)
fds[0] = fd;
else
fds[1] = fd;
}