diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-10-18 22:39:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-10-18 22:39:06 +0200 |
commit | 47a483a1abe52be2d7c884743824bb3929ab65b6 (patch) | |
tree | 2bfe1699449f36b0b83cc3fdad945a6cf9fa122f /src | |
parent | 3b63d2d31d0850bd7a81ab9b468218d2c4c461e8 (diff) |
manager: serialize/deserialize finish timestamp
Diffstat (limited to 'src')
-rw-r--r-- | src/manager.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c index f2ec2b72ad..e4559ffcb8 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2489,6 +2489,11 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds) { (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\n", + (unsigned long long) m->finish_timestamp.realtime, + (unsigned long long) m->finish_timestamp.monotonic); + HASHMAP_FOREACH_KEY(u, t, m->units, i) { if (u->meta.id != t) continue; @@ -2547,6 +2552,15 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { 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 log_debug("Unknown serialization item '%s'", l); } |