X Tutup
Skip to content

Commit fe50aae

Browse files
committed
core/serialization: call exec_runtime_deserialize_compat() independently of whether .serialize is defined
There is no reason to tie the two together: in principle we may have in the future a unit type which does not define .serialize/.deserialize_item, but we would still want to call the compat deserialization code for it.
1 parent 00fb6ca commit fe50aae

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/core/unit-serialize.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,15 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
498498
continue;
499499
}
500500

501-
if (unit_can_serialize(u)) {
502-
r = exec_runtime_deserialize_compat(u, l, v, fds);
503-
if (r < 0) {
504-
log_unit_warning(u, "Failed to deserialize runtime parameter '%s', ignoring.", l);
505-
continue;
506-
}
507-
501+
r = exec_runtime_deserialize_compat(u, l, v, fds);
502+
if (r < 0) {
503+
log_unit_warning(u, "Failed to deserialize runtime parameter '%s', ignoring.", l);
504+
continue;
505+
} else if (r > 0)
508506
/* Returns positive if key was handled by the call */
509-
if (r > 0)
510-
continue;
507+
continue;
511508

509+
if (unit_can_serialize(u)) {
512510
r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds);
513511
if (r < 0)
514512
log_unit_warning(u, "Failed to deserialize unit parameter '%s', ignoring.", l);

0 commit comments

Comments
 (0)
X Tutup