]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: a more informative error when SetProperties/StartTransientUnit fails
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 2 Apr 2023 19:08:35 +0000 (21:08 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Apr 2023 13:18:00 +0000 (15:18 +0200)
commit44d82df46e38c5bc36ed3722301eeae15df29763
tree37ca9f9cbc3da721db6456799891a5927b40dde1
parent6db00b5de149ec06efdc4b92bc3df40cabb58ba5
core: a more informative error when SetProperties/StartTransientUnit fails

I was changing how some properties are appended to the StartTransientUnit call
and messed up the message contents. When something is wrong with how the
message is structed, we would return a very generic
"Failed to start transient service unit: No such device or address".

Mention that it was property setting that failed, and translate ENXIO to a
different message. bus_unit_set_properties() or any of the children it calls
may also return other errors, in particular EBADMSG or ENOMEM, but the error
message that is generated for those is understandable, so we don't need to
"translate" them explicitly.

bus_unit_set_properties() is called from two places, so it seems nicer to
generate the message internally, rather than ask the caller to do that. Also,
now bus_unit_set_properties() always sets <error>, which is nicer for the
callers.
src/core/dbus-unit.c