#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;
bool ignore_order:1;
};
-Job* job_new(Manager *m, JobType type, Unit *unit);
+Job* job_new(Unit *unit, JobType type);
void job_uninstall(Job *j);
void job_free(Job *job);
void job_dump(Job *j, FILE*f, const char *prefix);
if (unit->job && unit->job->type == type)
j = unit->job;
else {
- j = job_new(unit->manager, type, unit);
+ j = job_new(unit, type);
if (!j)
return NULL;
}