chiark / gitweb /
transaction: change the linking of isolate jobs to the anchor
[elogind.git] / src / core / job.c
index 9199cf6a4b6a0e54041159ab8f472d707840a292..18ec823ebede3d0f9db04d2c0cd55609217a340f 100644 (file)
 #include "log.h"
 #include "dbus-job.h"
 
-Job* job_new(Manager *m, JobType type, Unit *unit) {
+Job* job_new(Unit *unit, JobType type) {
         Job *j;
 
-        assert(m);
         assert(type < _JOB_TYPE_MAX);
         assert(unit);
 
         if (!(j = new0(Job, 1)))
                 return NULL;
 
-        j->manager = m;
-        j->id = m->current_job_id++;
+        j->manager = unit->manager;
+        j->id = j->manager->current_job_id++;
         j->type = type;
         j->unit = unit;
 
@@ -117,8 +116,6 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool
 
         if (subject)
                 LIST_PREPEND(JobDependency, subject, subject->subject_list, l);
-        else
-                LIST_PREPEND(JobDependency, subject, object->manager->transaction_anchor, l);
 
         LIST_PREPEND(JobDependency, object, object->object_list, l);
 
@@ -130,8 +127,6 @@ void job_dependency_free(JobDependency *l) {
 
         if (l->subject)
                 LIST_REMOVE(JobDependency, subject, l->subject->subject_list, l);
-        else
-                LIST_REMOVE(JobDependency, subject, l->object->manager->transaction_anchor, l);
 
         LIST_REMOVE(JobDependency, object, l->object->object_list, l);