tree-wide: introduce strerror_safe()
This commit is contained in:
@@ -1425,7 +1425,7 @@ static int add_boot(sd_journal *j) {
|
||||
r = get_boots(j, NULL, &boot_id, arg_boot_offset);
|
||||
assert(r <= 1);
|
||||
if (r <= 0) {
|
||||
const char *reason = (r == 0) ? "No such boot ID in journal" : strerror(-r);
|
||||
const char *reason = (r == 0) ? "No such boot ID in journal" : strerror_safe(r);
|
||||
|
||||
if (sd_id128_is_null(arg_boot_id))
|
||||
log_error("Data from the specified boot (%+i) is not available: %s",
|
||||
|
||||
@@ -1061,7 +1061,7 @@ void server_driver_message(Server *s, pid_t object_pid, const char *message_id,
|
||||
/* We failed to format the message. Emit a warning instead. */
|
||||
char buf[LINE_MAX];
|
||||
|
||||
xsprintf(buf, "MESSAGE=Entry printing failed: %s", strerror(-r));
|
||||
xsprintf(buf, "MESSAGE=Entry printing failed: %s", strerror_safe(r));
|
||||
|
||||
n = 3;
|
||||
iovec[n++] = IOVEC_MAKE_STRING("PRIORITY=4");
|
||||
|
||||
Reference in New Issue
Block a user