diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2019-01-16 10:26:15 -0800 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-17 09:17:15 +0100 |
commit | 119f0f2876ea340cc41525e844487aa88551c219 (patch) | |
tree | 88189c96833f883a7c972d117eba6d6b3f748aaf /src/core/dbus-unit.c | |
parent | db2df5500ef3027476ce2434e6f4432cc0aa6b64 (diff) | |
download | systemd-119f0f2876ea340cc41525e844487aa88551c219.tar.gz |
core: Fix -EOPNOTSUPP emergency action error string
The error string for operations that are not supported (e.g. "shutdown" for
user-defined units) should take two arguments, where the first one is the type
of action being defined (i.e. "FailureAction" vs. "SuccessAction") and the
second is the string that was invalid.
Currently, the code prints this:
$ systemd-run --user --wait -p SuccessAction=poweroff true
Failed to start transient service unit: EmergencyAction setting invalid for manager type: SuccessAction
Change the format string to instead print:
$ systemd-run --user --wait -p SuccessAction=poweroff true
Failed to start transient service unit: SuccessAction setting invalid for manager type: poweroff
Diffstat (limited to 'src/core/dbus-unit.c')
-rw-r--r-- | src/core/dbus-unit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 385ee8bdca..17c2003c8f 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -1387,7 +1387,7 @@ static int bus_set_transient_emergency_action( r = parse_emergency_action(s, system, &v); if (r < 0) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, - r == -EOPNOTSUPP ? "EmergencyAction setting invalid for manager type: %s" + r == -EOPNOTSUPP ? "%s setting invalid for manager type: %s" : "Invalid %s setting: %s", name, s); |