summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-11-28 11:28:10 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-11-28 11:54:37 -0500
commit5e03c6e3b517286bbd65b48d88f60e5b83721894 (patch)
tree02e4a3ebbf5f94b7f6cd2bf3f76886b65f5fa542 /src/systemctl/systemctl.c
parent6872b0ddc4b748ba2dbe7e74e3bbde46d17a2656 (diff)
systemctl: append default suffix only if none present
Simplify unit_name_mangle() and unit_name_mangle_with_suffix() to always behave the same, and only append a suffix if there is no type suffix. If a user says 'isolate blah.device' it is better to return an error that the type cannot be isolated, than to try to isolate blah.device.target.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 4299429fbd..263755fec7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -2701,10 +2701,7 @@ static int expand_names(sd_bus *bus, char **names, const char* suffix, char ***r
STRV_FOREACH(name, names) {
char *t;
- if (suffix)
- t = unit_name_mangle_with_suffix(*name, MANGLE_GLOB, suffix);
- else
- t = unit_name_mangle(*name, MANGLE_GLOB);
+ t = unit_name_mangle_with_suffix(*name, MANGLE_GLOB, suffix);
if (!t)
return log_oom();