diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-07-18 01:46:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-07-18 01:46:52 +0200 |
commit | 6b78f9b4354010f8af2fe48c783ffd52b2db8f57 (patch) | |
tree | fc867017eb6a4fef2822264161ce4fefd444152a /src/core/unit.c | |
parent | 5b00c0168be6e7b11db7b26fc1712cd6cda3c2e3 (diff) |
unit: don't serialize job state, only unit state across switch-root
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 7994f7038e..ae6f69183d 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2401,7 +2401,7 @@ bool unit_can_serialize(Unit *u) { return UNIT_VTABLE(u)->serialize && UNIT_VTABLE(u)->deserialize_item; } -int unit_serialize(Unit *u, FILE *f, FDSet *fds) { +int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs) { int r; assert(u); @@ -2414,14 +2414,17 @@ int unit_serialize(Unit *u, FILE *f, FDSet *fds) { if ((r = UNIT_VTABLE(u)->serialize(u, f, fds)) < 0) return r; - if (u->job) { - fprintf(f, "job\n"); - job_serialize(u->job, f, fds); - } - if (u->nop_job) { - fprintf(f, "job\n"); - job_serialize(u->nop_job, f, fds); + if (serialize_jobs) { + if (u->job) { + fprintf(f, "job\n"); + job_serialize(u->job, f, fds); + } + + if (u->nop_job) { + fprintf(f, "job\n"); + job_serialize(u->nop_job, f, fds); + } } dual_timestamp_serialize(f, "inactive-exit-timestamp", &u->inactive_exit_timestamp); |