chiark / gitweb /
log: avoid calling the logging functions for log levels above the current maximum
[elogind.git] / src / tmpfiles / tmpfiles.c
index 42cc34d6c41576ece05a1a9242cd7a22daaa67c2..e23847bbea65e1180598720c92ab30c178d41d8e 100644 (file)
@@ -275,12 +275,15 @@ static int dir_cleanup(
                         continue;
 
                 if (fstatat(dirfd(d), dent->d_name, &s, AT_SYMLINK_NOFOLLOW) < 0) {
+                        if (errno == ENOENT)
+                                continue;
 
-                        if (errno != ENOENT) {
+                        /* FUSE, NFS mounts, SELinux might return EACCES */
+                        if (errno == EACCES)
+                                log_debug("stat(%s/%s) failed: %m", p, dent->d_name);
+                        else
                                 log_error("stat(%s/%s) failed: %m", p, dent->d_name);
-                                r = -errno;
-                        }
-
+                        r = -errno;
                         continue;
                 }
 
@@ -995,7 +998,7 @@ static void item_free(Item *i) {
         free(i);
 }
 
-define_trivial_cleanup_func(Item*, item_free)
+DEFINE_TRIVIAL_CLEANUP_FUNC(Item*, item_free);
 #define _cleanup_item_free_ _cleanup_(item_freep)
 
 static bool item_equal(Item *a, Item *b) {