From: Zbigniew Jędrzejewski-Szmek Date: Tue, 8 Jun 2021 14:28:59 +0000 (+0200) Subject: core/serialization: call exec_runtime_deserialize_compat() independently of whether... X-Git-Tag: v249-rc1~39^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe50aae5e15eb267b15a37c0c00a48b29fed8f11;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/unit-serialize.c b/src/core/unit-serialize.c index daf7c59cc15..f6305d879a3 100644 --- a/src/core/unit-serialize.c +++ b/src/core/unit-serialize.c @@ -498,17 +498,15 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { continue; } - if (unit_can_serialize(u)) { - r = exec_runtime_deserialize_compat(u, l, v, fds); - if (r < 0) { - log_unit_warning(u, "Failed to deserialize runtime parameter '%s', ignoring.", l); - continue; - } - + r = exec_runtime_deserialize_compat(u, l, v, fds); + if (r < 0) { + log_unit_warning(u, "Failed to deserialize runtime parameter '%s', ignoring.", l); + continue; + } else if (r > 0) /* Returns positive if key was handled by the call */ - if (r > 0) - continue; + continue; + if (unit_can_serialize(u)) { r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds); if (r < 0) log_unit_warning(u, "Failed to deserialize unit parameter '%s', ignoring.", l);