summaryrefslogtreecommitdiff
path: root/src/shared/bus-unit-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-08-16 18:07:30 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-08-17 07:08:37 +0900
commiteab62c01ef81adb85dbbb561b3102d1cf960f5b6 (patch)
tree6765f7aa06432a72c5f0280bf955d44e5d098ae9 /src/shared/bus-unit-util.c
parente4e6cfaad04d93873bc542b072eea2f34e607a01 (diff)
downloadsystemd-eab62c01ef81adb85dbbb561b3102d1cf960f5b6.tar.gz
manager: allow assignment of properties on target/swap/device units
E.g. Documentation or Markers could apply to any unit type. This already worked partially, because a direct dbus call could be made: After rebuild with the patch, but before the manager has been restarted: $ build/systemctl --user set-property dev-zram0.swap Markers=+needs-restart $ build/systemctl --user show -p Markers dev-zram0.swap Markers=needs-restart I noticed that that the rpm unit restart helper was throwing errors for target units. We should just let the Markers be set for those too, even if it doesn't do anything in the end. This way we don't need to special-case by unit type.
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r--src/shared/bus-unit-util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index edc2cfa937..2bf0d855b1 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -2640,12 +2640,10 @@ int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const cha
case UNIT_TARGET:
case UNIT_DEVICE:
case UNIT_SWAP:
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "Not supported unit type");
+ break;
default:
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "Invalid unit type");
+ assert_not_reached();
}
r = bus_append_unit_property(m, field, eq);