chiark / gitweb /
util: simplify proc_cmdline() to reuse get_process_cmdline()
[elogind.git] / src / shared / install.c
index 035b44cc520fe6aa118caa142c8333e17f5bfb03..cab93e8dc6b3ab140a330cf3a1084b2860c980dd 100644 (file)
@@ -1620,12 +1620,10 @@ int unit_file_enable(
         STRV_FOREACH(i, files) {
                 UnitFileState state;
 
+                /* We only want to know if this unit is masked, so we ignore
+                 * errors from unit_file_get_state, deferring other checks.
+                 * This allows templated units to be enabled on the fly. */
                 state = unit_file_get_state(scope, root_dir, *i);
-                if (state < 0) {
-                        log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
-                        return state;
-                }
-
                 if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
                         log_error("Failed to enable unit: Unit %s is masked", *i);
                         return -ENOTSUP;