tmpfiles: in dir_cleanup() take benefit that log_error_errno() returns the error code passed in

This commit is contained in:
Lennart Poettering 2018-01-22 15:31:01 +01:00
parent ecc1709c2c
commit 920ce82852
1 changed files with 2 additions and 4 deletions

View File

@ -652,10 +652,8 @@ static int dir_cleanup(
log_debug("Removing directory \"%s\".", sub_path);
if (unlinkat(dirfd(d), dent->d_name, AT_REMOVEDIR) < 0)
if (!IN_SET(errno, ENOENT, ENOTEMPTY)) {
log_error_errno(errno, "rmdir(%s): %m", sub_path);
r = -errno;
}
if (!IN_SET(errno, ENOENT, ENOTEMPTY))
r = log_error_errno(errno, "rmdir(%s): %m", sub_path);
} else {
/* Skip files for which the sticky bit is