From 7e91f16f1c5f60a766e280dbd7659e5817877ccf Mon Sep 17 00:00:00 2001 From: afonso Date: Sun, 12 May 2024 23:49:00 +0100 Subject: [PATCH] help pls --- src/djumbai_dequeue/djumbai_dequeue.c | 2 +- src/djumbai_send/djumbai_send.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/djumbai_dequeue/djumbai_dequeue.c b/src/djumbai_dequeue/djumbai_dequeue.c index 97798f8..cc24447 100644 --- a/src/djumbai_dequeue/djumbai_dequeue.c +++ b/src/djumbai_dequeue/djumbai_dequeue.c @@ -25,7 +25,7 @@ int main() { exit(EXIT_FAILURE); } int message_queue_fd; - message_queue_fd = open(message_queue_path, O_RDONLY); + message_queue_fd = open(message_queue_path, O_RDWR); if (message_queue_fd == -1) { if (errno == ENOENT) { // FIFO does not exist diff --git a/src/djumbai_send/djumbai_send.c b/src/djumbai_send/djumbai_send.c index 648471b..33b0f90 100644 --- a/src/djumbai_send/djumbai_send.c +++ b/src/djumbai_send/djumbai_send.c @@ -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);