From: anthisfan Date: Sun, 14 Sep 2025 15:04:47 +0000 (+0900) Subject: systemd-path: return accumulated error instead of last result X-Git-Tag: v258~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=778e95420a66ca34eb78008ccfac6153adf26310;p=thirdparty%2Fsystemd.git systemd-path: return accumulated error instead of last result Because it returns the result of the final sd_path_lookup() call rather than the return value of RET_GATHER, it appears that it may return success even if an error occurs during processing. With this patch, errors encountered during the loop will be properly tallied and returned, and failures will not be silently ignored. Signed-off-by: anthisfan --- diff --git a/src/path/path-tool.c b/src/path/path-tool.c index 41d0ba861cc..3dc31832b38 100644 --- a/src/path/path-tool.c +++ b/src/path/path-tool.c @@ -146,7 +146,7 @@ static int list_paths(void) { printf("%s%s:%s %s\n", ansi_highlight(), t, ansi_normal(), p); } - return r; + return ret; } static int print_path(const char *n) {