mirror of
https://github.com/systemd/systemd.git
synced 2025-09-13 05:44:40 +03:00
Merge pull request #31938 from YHNdnzj/journalctl-facility
journalctl: explicitly check < 0 for error
This commit is contained in:
@@ -47,10 +47,8 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
|||||||
s = strdup(name##_table[i]); \
|
s = strdup(name##_table[i]); \
|
||||||
if (!s) \
|
if (!s) \
|
||||||
return -ENOMEM; \
|
return -ENOMEM; \
|
||||||
} else { \
|
} else if (asprintf(&s, "%i", i) < 0) \
|
||||||
if (asprintf(&s, "%i", i) < 0) \
|
|
||||||
return -ENOMEM; \
|
return -ENOMEM; \
|
||||||
} \
|
|
||||||
*str = s; \
|
*str = s; \
|
||||||
return 0; \
|
return 0; \
|
||||||
}
|
}
|
||||||
|
@@ -344,7 +344,7 @@ static int help_facilities(void) {
|
|||||||
for (int i = 0; i < LOG_NFACILITIES; i++) {
|
for (int i = 0; i < LOG_NFACILITIES; i++) {
|
||||||
_cleanup_free_ char *t = NULL;
|
_cleanup_free_ char *t = NULL;
|
||||||
|
|
||||||
if (log_facility_unshifted_to_string_alloc(i, &t))
|
if (log_facility_unshifted_to_string_alloc(i, &t) < 0)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
puts(t);
|
puts(t);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user