mirror of
https://github.com/systemd/systemd.git
synced 2024-12-19 15:13:36 +08:00
catalog: fix error codes handling in catalog_list_items
Previously r was set to zero and so if(r<0) was never true.
This commit is contained in:
parent
2e8fb7026d
commit
464264ac5a
@ -617,7 +617,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
|
||||
if (k < 0) {
|
||||
log_error("Failed to parse id128 '%s': %s",
|
||||
*item, strerror(-k));
|
||||
if (r < 0)
|
||||
if (r == 0)
|
||||
r = k;
|
||||
continue;
|
||||
}
|
||||
@ -627,7 +627,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
|
||||
log_full(k == -ENOENT ? LOG_NOTICE : LOG_ERR,
|
||||
"Failed to retrieve catalog entry for '%s': %s",
|
||||
*item, strerror(-k));
|
||||
if (r < 0)
|
||||
if (r == 0)
|
||||
r = k;
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user