diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-28 16:33:31 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-28 16:34:21 +0100 |
commit | 6233b9023b18148b2553b4d4fba246701b55916e (patch) | |
tree | 1a6183d455812ccecf079a409dfefc602d3bfb69 | |
parent | d813d7a37211680b3110e36b3bcaff7510a14378 (diff) |
systemctl: don't mangle unit names in check_unit_generic()
As it turns out all callers of check_unit_generic() already mangle unit names, or get the unit names directly from PID
1 (and hence arein normalized form anyway), hence there's no point in mangling then...
-rw-r--r-- | src/systemctl/systemctl.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 73f5710b9c..8a43d0174f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -2411,16 +2411,12 @@ static int unit_find_paths( static int check_one_unit(sd_bus *bus, const char *name, const char *good_states, bool quiet) { _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; - _cleanup_free_ char *n = NULL, *state = NULL; + _cleanup_free_ char *state = NULL; const char *path; int r; assert(name); - r = unit_name_mangle(name, UNIT_NAME_NOGLOB, &n); - if (r < 0) - return log_error_errno(r, "Failed to mangle unit name: %m"); - /* We don't use unit_dbus_path_from_name() directly since we * don't want to load the unit if it isn't loaded. */ @@ -2432,7 +2428,7 @@ static int check_one_unit(sd_bus *bus, const char *name, const char *good_states "GetUnit", NULL, &reply, - "s", n); + "s", name); if (r < 0) { if (!quiet) puts("unknown"); |