mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-03 23:38:39 +00:00
core: make sure to serialize jobs for all units
Previously we wouldn't serialize jobs for units that themselves have nothing to serialize. http://lists.freedesktop.org/archives/systemd-devel/2014-May/019051.html (cherry picked from commit9bdb98c594) (cherry picked from commit75ee3c9da1) Conflicts: src/core/unit.c
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
f7da070b21
commit
54fe753272
@@ -2166,9 +2166,6 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) {
|
||||
if (u->id != t)
|
||||
continue;
|
||||
|
||||
if (!unit_can_serialize(u))
|
||||
continue;
|
||||
|
||||
/* Start marker */
|
||||
fputs(u->id, f);
|
||||
fputc('\n', f);
|
||||
|
||||
+10
-12
@@ -2293,12 +2293,11 @@ int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs) {
|
||||
assert(f);
|
||||
assert(fds);
|
||||
|
||||
if (!unit_can_serialize(u))
|
||||
return 0;
|
||||
|
||||
r = UNIT_VTABLE(u)->serialize(u, f, fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (unit_can_serialize(u)) {
|
||||
r = UNIT_VTABLE(u)->serialize(u, f, fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
dual_timestamp_serialize(f, "inactive-exit-timestamp", &u->inactive_exit_timestamp);
|
||||
dual_timestamp_serialize(f, "active-enter-timestamp", &u->active_enter_timestamp);
|
||||
@@ -2365,9 +2364,6 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
assert(f);
|
||||
assert(fds);
|
||||
|
||||
if (!unit_can_serialize(u))
|
||||
return 0;
|
||||
|
||||
for (;;) {
|
||||
char line[LINE_MAX], *l, *v;
|
||||
size_t k;
|
||||
@@ -2480,9 +2476,11 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
continue;
|
||||
}
|
||||
|
||||
r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (unit_can_serialize(u)) {
|
||||
r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user