]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: drop unnecessary unit_is_masked() check in edit
authorgvenugo3 <gvenugo3@asu.edu>
Tue, 11 Nov 2025 16:54:49 +0000 (09:54 -0700)
committergvenugo3 <gvenugo3@asu.edu>
Tue, 11 Nov 2025 16:54:49 +0000 (09:54 -0700)
The unit_is_masked() check will be performed later by unit_find_paths(),
making this early check redundant.

src/systemctl/systemctl-edit.c

index ef2735ddca16944367aa1f2724509c5732f3a37d..9847ee43c4af6639b8ef5db016aa8dd5f4940e0a 100644 (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;