chiark / gitweb /
dbus: expose cgroup properties in introspection everywhere
[elogind.git] / src / core / transaction.c
index 610344eff3f256d01a4e67478dab4f1c3eccc261..5259a5b7ca94f9b3e4284ede38d87d7ce5e2fcc5 100644 (file)
@@ -140,7 +140,7 @@ static void transaction_merge_and_delete_job(Transaction *tr, Job *j, Job *other
         transaction_delete_job(tr, other, true);
 }
 
-static bool job_is_conflicted_by(Job *j) {
+_pure_ static bool job_is_conflicted_by(Job *j) {
         JobDependency *l;
 
         assert(j);
@@ -320,7 +320,7 @@ rescan:
         }
 }
 
-static bool unit_matters_to_anchor(Unit *u, Job *j) {
+_pure_ static bool unit_matters_to_anchor(Unit *u, Job *j) {
         assert(u);
         assert(!j->transaction_prev);
 
@@ -851,12 +851,13 @@ int transaction_add_job_and_dependencies(
 
         if (unit->load_state != UNIT_LOADED &&
             unit->load_state != UNIT_ERROR &&
+            unit->load_state != UNIT_NOT_FOUND &&
             unit->load_state != UNIT_MASKED) {
                 dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->id);
                 return -EINVAL;
         }
 
-        if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
+        if (type != JOB_STOP && (unit->load_state == UNIT_ERROR || unit->load_state == UNIT_NOT_FOUND)) {
                 dbus_set_error(e, BUS_ERROR_LOAD_FAILED,
                                "Unit %s failed to load: %s. "
                                "See system logs and 'systemctl status %s' for details.",