fix: waitpid infinite loop

This commit is contained in:
Camille Chauvet
2023-03-13 19:29:20 +01:00
parent ee3d535393
commit f5940ee99e
2 changed files with 23 additions and 11 deletions

View File

@ -1,11 +1,18 @@
#include "./utils.h"
#include <stdio.h>
void ft_closer(int fds[2])
{
if (fds[0] > 2)
{
//dprintf(2, "close(%d)\n", fds[0]);
close(fds[0]);
}
if (fds[1] > 2)
{
//dprintf(2, "close(%d)\n", fds[1]);
close(fds[1]);
}
}
void ft_add_fd(int fds[2], int fd)