From 778e95420a66ca34eb78008ccfac6153adf26310 Mon Sep 17 00:00:00 2001 From: anthisfan Date: Mon, 15 Sep 2025 00:04:47 +0900 Subject: [PATCH] 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 --- src/path/path-tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.47.3