From 46b10c558e1267f7b223f93e10234a5986646edd Mon Sep 17 00:00:00 2001 From: afonso Date: Sun, 12 May 2024 21:14:17 +0100 Subject: [PATCH] change to faccessat from access --- src/djumbai_dequeue/djumbai_dequeue.c | 2 +- src/djumbai_send/djumbai_send.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/djumbai_dequeue/djumbai_dequeue.c b/src/djumbai_dequeue/djumbai_dequeue.c index 5a2a5f6..b6a61a3 100644 --- a/src/djumbai_dequeue/djumbai_dequeue.c +++ b/src/djumbai_dequeue/djumbai_dequeue.c @@ -10,7 +10,7 @@ int main() { const char *message_queue_path = "/djumbai/fifos/message_queue"; - if (access(message_queue_path, F_OK) != -1) { + if (faccessat(AT_FDCWD,message_queue_path, F_OK,AT_EACCESS) != -1) { // FIFO exists, delete it if (unlink(message_queue_path) == -1) { perror("unlink"); diff --git a/src/djumbai_send/djumbai_send.c b/src/djumbai_send/djumbai_send.c index b943a04..b898915 100644 --- a/src/djumbai_send/djumbai_send.c +++ b/src/djumbai_send/djumbai_send.c @@ -16,7 +16,7 @@ int main() { return 1; } const char *send_fifo_path = "fifos/send_fifo"; - if (access(send_fifo_path, F_OK) != -1) { + if (faccessat(AT_FDCWD,send_fifo_path, F_OK,AT_EACCESS) != -1) { // FIFO exists, delete it if (unlink(send_fifo_path) == -1) { perror("unlink");