summaryrefslogtreecommitdiff
path: root/src/libunixonacid/open2_at.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-04-16 12:57:52 +0000
committerLaurent Bercot <ska@appnovation.com>2024-04-16 12:57:52 +0000
commit825b80eaa311b0aec4c00614f38f3eb63949d5a7 (patch)
tree624f702487d9acdd3cc85060cfe2edc388cf7096 /src/libunixonacid/open2_at.c
parentbfc53cfde4fdda343647678fcd21b38a44f2de08 (diff)
downloadskalibs-825b80eaa311b0aec4c00614f38f3eb63949d5a7.tar.xz
Tentative support for old MacOS with no O_CLOEXEC
Also add a prototype for gol, not finished yet. Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libunixonacid/open2_at.c')
-rw-r--r--src/libunixonacid/open2_at.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libunixonacid/open2_at.c b/src/libunixonacid/open2_at.c
index 76d79cc..d96c0b7 100644
--- a/src/libunixonacid/open2_at.c
+++ b/src/libunixonacid/open2_at.c
@@ -11,14 +11,14 @@
#include <skalibs/nonposix.h>
#include <errno.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open2_at (int dirfd, char const *file, int flags)
{
int fd ;
- do fd = openat(dirfd, file, flags) ;
+ do fd = openat(dirfd, file, flags) ; /* all systems supporting openat() have O_CLOEXEC */
while (fd == -1 && errno == EINTR) ;
return fd ;
}
@@ -26,8 +26,9 @@ int open2_at (int dirfd, char const *file, int flags)
#else
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>