mirror of
https://github.com/systemd/systemd.git
synced 2026-08-12 12:16:06 +00:00
systemctl: drop unnecessary unit_is_masked() check in edit
The unit_is_masked() check will be performed later by unit_find_paths(), making this early check redundant.
This commit is contained in:
@@ -354,14 +354,6 @@ int verb_edit(int argc, char *argv[], void *userdata) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"With 'edit --stdin --full', exactly one unit for editing must be specified.");
|
||||
|
||||
STRV_FOREACH(tmp, names) {
|
||||
r = unit_is_masked(bus, *tmp);
|
||||
if (r < 0 && r != -ENOENT)
|
||||
return log_error_errno(r, "Failed to check if unit %s is masked: %m", *tmp);
|
||||
if (r > 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot edit %s: unit is masked.", *tmp);
|
||||
}
|
||||
|
||||
r = find_paths_to_edit(bus, &context, names);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user