summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-21 18:05:44 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-21 18:05:44 +0200
commit10a8700606d832ba88706f35e63d37b98c409d10 (patch)
tree4ed4eb6a3ab3658a5e2215ee4e4d8bc098b04f8a
parent8519d8f58ec3c5f8488be0ee557a30c21b1d0616 (diff)
tree-wide: get rid of more strerror() calls
-rw-r--r--src/nspawn/nspawn.c11
-rw-r--r--src/shared/logs-show.c8
-rw-r--r--src/timedate/timedated.c6
3 files changed, 13 insertions, 12 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 6d4aaddc67..1a9b3be5ec 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -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);
}
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 27f407229f..54179e94c9 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -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;
}
}
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 0d4a9dd7e2..d48fc822e2 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -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 */