chiark / gitweb /
unit: replace recursive_stop by stop_retroactively to simplify things a little
[elogind.git] / src / manager.c
index 37f0d0492916e31587359e3053a9ca5b9cac172e..b6a1da7fa46a1c0635cc3e22146402bda4bacd13 100644 (file)
@@ -1413,7 +1413,7 @@ static int transaction_add_job_and_dependencies(
         if (type != JOB_STOP && unit->meta.load_state == UNIT_ERROR) {
                 dbus_set_error(e, BUS_ERROR_LOAD_FAILED,
                                "Unit %s failed to load: %s. "
-                               "You might find more information in the system logs.",
+                               "See system logs and 'systemctl status' for details.",
                                unit->meta.id,
                                strerror(-unit->meta.load_error));
                 return -EINVAL;
@@ -2490,14 +2490,8 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds) {
         assert(f);
         assert(fds);
 
-        fprintf(f, "startup-timestamp=%llu %llu\n",
-                (unsigned long long) m->startup_timestamp.realtime,
-                (unsigned long long) m->startup_timestamp.monotonic);
-
-        if (dual_timestamp_is_set(&m->finish_timestamp))
-                fprintf(f, "finish-timestamp=%llu %llu\n",
-                        (unsigned long long) m->finish_timestamp.realtime,
-                        (unsigned long long) m->finish_timestamp.monotonic);
+        dual_timestamp_serialize(f, "startup-timestamp", &m->startup_timestamp);
+        dual_timestamp_serialize(f, "finish-timestamp", &m->finish_timestamp);
 
         fputc('\n', f);
 
@@ -2550,25 +2544,11 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                 if (l[0] == 0)
                         break;
 
-                if (startswith(l, "startup-timestamp=")) {
-                        unsigned long long a, b;
-
-                        if (sscanf(l+18, "%lli %llu", &a, &b) != 2)
-                                log_debug("Failed to parse startup timestamp value %s", l+18);
-                        else {
-                                m->startup_timestamp.realtime = a;
-                                m->startup_timestamp.monotonic = b;
-                        }
-                } else if (startswith(l, "finish-timestamp=")) {
-                        unsigned long long a, b;
-
-                        if (sscanf(l+18, "%lli %llu", &a, &b) != 2)
-                                log_debug("Failed to parse finish timestamp value %s", l+18);
-                        else {
-                                m->finish_timestamp.realtime = a;
-                                m->finish_timestamp.monotonic = b;
-                        }
-                } else
+                if (startswith(l, "startup-timestamp="))
+                        dual_timestamp_deserialize(l+18, &m->startup_timestamp);
+                else if (startswith(l, "finish-timestamp="))
+                        dual_timestamp_deserialize(l+17, &m->finish_timestamp);
+                else
                         log_debug("Unknown serialization item '%s'", l);
         }