mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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 <gtpgx305@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user