]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/unit-serialize.c
core/serialization: drop misleadingly-named unit_can_serialize()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Jun 2021 14:30:44 +0000 (16:30 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Jun 2021 12:17:58 +0000 (14:17 +0200)
commit1085c0eb692623a4398df80a45f99ea2d8031bf7
treed9ec671b851d88a37415923fe64e1f450c2839e4
parentfe50aae5e15eb267b15a37c0c00a48b29fed8f11
core/serialization: drop misleadingly-named unit_can_serialize()

All unit types can be serialized. This function was really checking whether the
unit type has custom serialization/deserialization code. But we don't need a
function for this.

Also, the check that both .serialize() and .deserialize_item() are defined is
better written as an assert. Not we have a function which would skip
serialization/deserializaton for the unit if we forgot to set either of the
fields.
src/core/unit-serialize.c
src/core/unit.c
src/core/unit.h