]> git.sesse.net Git - plocate/commitdiff
Compile on platforms without O_NOATIME.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 12 Dec 2020 11:54:31 +0000 (12:54 +0100)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 12 Dec 2020 11:54:31 +0000 (12:54 +0100)
updatedb.cpp

index 17067b8d0d10e705048f7d76ab2cc0081a94027e..1465b5b54fc11fd80a11060ffad511ecc1e0cb1a 100644 (file)
@@ -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) {