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:
gvenugo3
2025-11-11 09:54:49 -07:00
parent 7b3046e693
commit cedc98c581

View File

@@ -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;