chiark / gitweb /
hashmap: introduce hash_ops to make struct Hashmap smaller
[elogind.git] / src / core / transaction.c
index d23a45c3f517b776351ec7c75bdc37ecd4dfaa4b..dbb4133fe38f853f893a3c90b72082002414e7d8 100644 (file)
@@ -381,7 +381,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
                                       "Found dependency on %s/%s",
                                       k->unit->id, job_type_to_string(k->type));
 
-                        if (!delete &&
+                        if (!delete && hashmap_get(tr->jobs, k->unit) &&
                             !unit_matters_to_anchor(k->unit, k)) {
                                 /* Ok, we can drop this one, so let's
                                  * do so. */
@@ -870,7 +870,7 @@ int transaction_add_job_and_dependencies(
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
-                if (unit->load_error == -ENOENT)
+                if (unit->load_error == -ENOENT || unit->manager->test_run)
                         sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
                                           "Unit %s failed to load: %s.",
                                           unit->id,
@@ -1143,7 +1143,7 @@ Transaction *transaction_new(bool irreversible) {
         if (!tr)
                 return NULL;
 
-        tr->jobs = hashmap_new(trivial_hash_func, trivial_compare_func);
+        tr->jobs = hashmap_new(NULL);
         if (!tr->jobs) {
                 free(tr);
                 return NULL;