]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: fold five lines into two
authorLennart Poettering <lennart@poettering.net>
Mon, 22 Jan 2018 14:29:30 +0000 (15:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 22 Jan 2018 14:30:05 +0000 (15:30 +0100)
log_full_errno() has all these nice benefits, let's make use of them to
shorten five lines into two.

src/tmpfiles/tmpfiles.c

index 96ffa420895c193306d37c35c66ff33446487412..66dabc74f1616b748014d35c188bee0f07d3213b 100644 (file)
@@ -547,11 +547,8 @@ static int dir_cleanup(
                                 continue;
 
                         /* FUSE, NFS mounts, SELinux might return EACCES */
-                        if (errno == EACCES)
-                                log_debug_errno(errno, "stat(%s/%s) failed: %m", p, dent->d_name);
-                        else
-                                log_error_errno(errno, "stat(%s/%s) failed: %m", p, dent->d_name);
-                        r = -errno;
+                        r = log_full_errno(errno == EACCES ? LOG_DEBUG : LOG_ERR, errno,
+                                           "stat(%s/%s) failed: %m", p, dent->d_name);
                         continue;
                 }