From 9980e72ff12857b862705979d2ff84820c2fc097 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 12 Dec 2020 12:54:31 +0100 Subject: [PATCH] Compile on platforms without O_NOATIME. --- updatedb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/updatedb.cpp b/updatedb.cpp index 17067b8..1465b5b 100644 --- a/updatedb.cpp +++ b/updatedb.cpp @@ -92,7 +92,11 @@ int opendir_noatime(int dirfd, const char *path) static bool noatime_failed = false; if (!noatime_failed) { +#ifdef O_NOATIME int fd = openat(dirfd, path, O_RDONLY | O_DIRECTORY | O_NOATIME); +#else + int fd = openat(dirfd, path, O_RDONLY | O_DIRECTORY); +#endif if (fd != -1) { return fd; } else if (errno == EPERM) { -- 2.39.2