tree-wide: get rid of more strerror() calls
This commit is contained in:
+6
-5
@@ -2139,11 +2139,12 @@ static int reset_audit_loginuid(void) {
|
||||
|
||||
r = write_string_file("/proc/self/loginuid", "4294967295");
|
||||
if (r < 0) {
|
||||
log_error("Failed to reset audit login UID. This probably means that your kernel is too\n"
|
||||
"old and you have audit enabled. Note that the auditing subsystem is known to\n"
|
||||
"be incompatible with containers on old kernels. Please make sure to upgrade\n"
|
||||
"your kernel or to off auditing with 'audit=0' on the kernel command line before\n"
|
||||
"using systemd-nspawn. Sleeping for 5s... (%s)\n", strerror(-r));
|
||||
log_error_errno(r,
|
||||
"Failed to reset audit login UID. This probably means that your kernel is too\n"
|
||||
"old and you have audit enabled. Note that the auditing subsystem is known to\n"
|
||||
"be incompatible with containers on old kernels. Please make sure to upgrade\n"
|
||||
"your kernel or to off auditing with 'audit=0' on the kernel command line before\n"
|
||||
"using systemd-nspawn. Sleeping for 5s... (%m)");
|
||||
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
@@ -409,8 +409,8 @@ static int output_verbose(
|
||||
if (r == -ENOENT)
|
||||
log_debug("Source realtime timestamp not found");
|
||||
else if (r < 0) {
|
||||
log_full(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_ERR,
|
||||
"Failed to get source realtime timestamp: %s", strerror(-r));
|
||||
log_full_errno(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_ERR, r,
|
||||
"Failed to get source realtime timestamp: %m");
|
||||
return r;
|
||||
} else {
|
||||
_cleanup_free_ char *value = NULL;
|
||||
@@ -429,8 +429,8 @@ static int output_verbose(
|
||||
if (r < 0) {
|
||||
r = sd_journal_get_realtime_usec(j, &realtime);
|
||||
if (r < 0) {
|
||||
log_full(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_ERR,
|
||||
"Failed to get realtime timestamp: %s", strerror(-r));
|
||||
log_full_errno(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_ERR, r,
|
||||
"Failed to get realtime timestamp: %m");
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ static int property_get_rtc_time(
|
||||
log_debug("/dev/rtc not found.");
|
||||
t = 0; /* no RTC found */
|
||||
} else if (r < 0)
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to read RTC: %s", strerror(-r));
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to read RTC: %m");
|
||||
else
|
||||
t = (usec_t) timegm(&tm) * USEC_PER_SEC;
|
||||
|
||||
@@ -402,7 +402,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata, s
|
||||
r = context_write_data_timezone(c);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to set time zone: %m");
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to set time zone: %s", strerror(-r));
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to set time zone: %m");
|
||||
}
|
||||
|
||||
/* 2. Tell the kernel our timezone */
|
||||
@@ -465,7 +465,7 @@ static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata,
|
||||
r = context_write_data_local_rtc(c);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to set RTC to local/UTC: %m");
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to set RTC to local/UTC: %s", strerror(-r));
|
||||
return sd_bus_error_set_errnof(error, r, "Failed to set RTC to local/UTC: %m");
|
||||
}
|
||||
|
||||
/* 2. Tell the kernel our timezone */
|
||||
|
||||
Reference in New Issue
Block a user