From: Yu Watanabe Date: Fri, 28 Feb 2025 11:22:42 +0000 (+0900) Subject: recurse-dir: fix wrong assertion and error code in log X-Git-Tag: v257.4~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=349012c4935c49bde6bb7bc6daa8e4a783657338;p=thirdparty%2Fsystemd.git recurse-dir: fix wrong assertion and error code in log Fixes a bug in b5a07e524e42d2594174ca1a5b72aa4fdb9af94c (v250). (cherry picked from commit 91421f8379b66316f937d56c60c2e782b7a79eca) --- diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c index 378fd92b061..f5848e52fe5 100644 --- a/src/basic/recurse-dir.c +++ b/src/basic/recurse-dir.c @@ -321,7 +321,7 @@ int recurse_dir( if (r < 0) { log_debug_errno(r, "Failed to stat directory entry '%s': %m", p); - assert(errno <= RECURSE_DIR_SKIP_STAT_INODE_ERROR_MAX - RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE); + assert(-r <= RECURSE_DIR_SKIP_STAT_INODE_ERROR_MAX - RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE); r = func(RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE + -r, p, @@ -351,7 +351,7 @@ int recurse_dir( * guarantee that RECURSE_DIR_ENTRY is strictly issued for * non-directory dirents. */ - log_debug_errno(r, "Non-directory entry '%s' suddenly became a directory: %m", p); + log_debug("Non-directory entry '%s' suddenly became a directory.", p); r = func(RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE + EISDIR, p,