diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-01-15 11:07:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 11:07:02 +0100 |
commit | 3b41c4dfbc73d52771c9df86a3018b6b5df53244 (patch) | |
tree | 6ece1136691276ccf4a1850d61e6cae54dd90046 | |
parent | f1c86dd9abec1707b4a024f8bb6ade9630d9b5a9 (diff) | |
parent | e4d22a9f321e3d7c4a3e3bc1783c5204d79d80e3 (diff) | |
download | systemd-3b41c4dfbc73d52771c9df86a3018b6b5df53244.tar.gz |
Merge pull request #18244 from anitazha/systemctledit
systemctl-edit fixes
-rw-r--r-- | src/systemctl/systemctl-edit.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c index f6e8671a38..4186ec3aea 100644 --- a/src/systemctl/systemctl-edit.c +++ b/src/systemctl/systemctl-edit.c @@ -398,16 +398,14 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) { /* If loading of the unit failed server side complete, then the server won't tell us * the unit file path. In that case, find the file client side. */ log_debug_errno(r, "Unit '%s' was not loaded correctly, retrying client-side.", *name); - r = unit_find_paths(bus, *name, &lp, true, &cached_name_map, &cached_id_map, &path, NULL); + r = unit_find_paths(bus, *name, &lp, true, &cached_name_map, &cached_id_map, &path, &unit_paths); } if (r == -ERFKILL) return log_error_errno(r, "Unit '%s' masked, cannot edit.", *name); if (r < 0) return r; - if (r == 0) { - assert(!path); - + if (!path) { if (!arg_force) { log_info("Run 'systemctl edit%s --force --full %s' to create a new unit.", arg_scope == UNIT_FILE_GLOBAL ? " --global" : @@ -422,8 +420,6 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) { arg_full ? NULL : ".d/override.conf", NULL, &new_path, &tmp_path); } else { - assert(path); - unit_name = basename(path); /* We follow unit aliases, but we need to propagate the instance */ if (unit_name_is_valid(*name, UNIT_NAME_INSTANCE) && |