This commit is contained in:
Afonso Franco 2024-05-12 23:49:00 +01:00
parent 49fb1af798
commit 7e91f16f1c
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54
2 changed files with 2 additions and 4 deletions

View file

@ -115,10 +115,10 @@ int main() {
dup2(pipe_to_child[0], STDIN_FILENO);
execlp("./bin/djumbai_client_receive", "djumbai_client_receive", NULL);
close(pipe_to_child[0]);
// If execlp fails
perror("execlp");
close(pipe_to_child[0]);
exit(EXIT_FAILURE);
} else { // Parent process
close(pipe_to_child[0]); // Close read end of pipe
@ -127,8 +127,6 @@ int main() {
// Close the write end of the pipe
close(pipe_to_child[1]);
// Wait for the child process to finish
wait(NULL);
}
}
close(send_fifo_fd);