]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: get rid of more strerror() calls
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Apr 2015 16:05:44 +0000 (18:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Apr 2015 16:05:44 +0000 (18:05 +0200)
src/nspawn/nspawn.c
src/shared/logs-show.c
src/timedate/timedated.c

index 6d4aaddc679ad2d2f640dc6dcd105ef3caa498e6..1a9b3be5ecbdefb141de764a002ba748d4d247d2 100644 (file)
@@ -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);
         }
index 27f407229fe24cde11772d6c21ac7e26de3d235b..54179e94c9e5d00611c99858a63808868f957fc5 100644 (file)
@@ -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;
                 }
         }
index 0d4a9dd7e21230a02df7b9e3ba303cf0432fa4b5..d48fc822e24a08b742fe6151cb5c53d9cbef1867 100644 (file)
@@ -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 */