From fe50aae5e15eb267b15a37c0c00a48b29fed8f11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 8 Jun 2021 16:28:59 +0200 Subject: [PATCH] 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. --- src/core/unit-serialize.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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); -- 2.47.3