From: Lennart Poettering Date: Mon, 22 Jan 2018 14:31:01 +0000 (+0100) Subject: tmpfiles: in dir_cleanup() take benefit that log_error_errno() returns the error... X-Git-Tag: v237~57^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=920ce828524afee08a01a73f63205df5dc2c134b;p=thirdparty%2Fsystemd.git tmpfiles: in dir_cleanup() take benefit that log_error_errno() returns the error code passed in --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 66dabc74f16..128abb835e2 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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