changing pipe_redirect function to change what the child process closes and dups (which pipe ends)
changing what the parent process closes (which pipe ends)
changing the waitpit in wait_for_pipeline to -1 so that the child processes are not waited for in a sequence
119
Different free function for child (to get rid of still reachable leaks) and parent process
Allocation and freeing done locally in exec_pipeline
120
Exec files now norminette compliant
File descriptor closing solved by:
(parent) Adding close in an if and else statement in wait_for_pipeline:
if cds_num == 1, the read end of the last pipe (-1 is there because the while loop in exec_pipeline increments i to out of bounds) is closed
else, the write end of the second to last pipe (-1 is there because the while loop in exec_pipeline increments i to out of bounds) is closed
(child) Adding close of the write end of the current pipe after (possible) dupping
To test open fds:
cat Makefile
echo hi
echo hi | wc -l
cat Makefile | head -n 5
cat /dev/urandom | head -n 1 (some will stay open bcs of SIGPIPE, but not in child or parent)
122
Corrected wrong reassignement of content in a while loop
123
Improved tokens redirection to all the below cases:
Exec hanging
119
120
122
123