1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-23 13:57:33 +03:00

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-06-08 16:28:59 +02:00
parent 00fb6caf70
commit fe50aae5e1

View File

@ -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);