help pls
This commit is contained in:
parent
49fb1af798
commit
7e91f16f1c
2 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue