]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: improve debug logging around O_NOATIME fallback
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Jun 2024 07:55:48 +0000 (09:55 +0200)
committerLuca Boccassi <bluca@debian.org>
Tue, 18 Jun 2024 13:45:59 +0000 (14:45 +0100)
src/tmpfiles/tmpfiles.c

index ca163fd5f73aed39f9c9d04feac41741951ecd87..e3eca2ef27e1d5d9a20b932656619b7cd4e8c5c6 100644 (file)
@@ -547,14 +547,13 @@ static DIR* xopendirat_nomod(int dirfd, const char *path) {
                 return dir;
 
         if (!IN_SET(errno, ENOENT, ELOOP))
-                log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", dirfd == AT_FDCWD ? "" : "sub", path);
-
-        if (errno != EPERM)
+                log_debug_errno(errno, "Cannot open %sdirectory \"%s\" with O_NOATIME: %m", dirfd == AT_FDCWD ? "" : "sub", path);
+        if (!ERRNO_IS_PRIVILEGE(errno))
                 return NULL;
 
         dir = xopendirat(dirfd, path, O_NOFOLLOW);
         if (!dir)
-                log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", dirfd == AT_FDCWD ? "" : "sub", path);
+                log_debug_errno(errno, "Cannot open %sdirectory \"%s\" with or without O_NOATIME: %m", dirfd == AT_FDCWD ? "" : "sub", path);
 
         return dir;
 }