X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjob.c;h=c3b529e920fe44b3314c8dfb6ab921e4fd2c6394;hb=b95cf3629e8d78a0d28e71b0f5559fa9a8c038b5;hp=d08bfe9a77d030805656b315bf7c082a1c3ab377;hpb=cc42e0817ff82c5faa21678325b6683493b2e792;p=elogind.git diff --git a/src/job.c b/src/job.c index d08bfe9a7..c3b529e92 100644 --- a/src/job.c +++ b/src/job.c @@ -93,7 +93,7 @@ void job_free(Job *j) { free(j); } -JobDependency* job_dependency_new(Job *subject, Job *object, bool matters) { +JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts) { JobDependency *l; assert(object); @@ -109,6 +109,7 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters) { l->subject = subject; l->object = object; l->matters = matters; + l->conflicts = conflicts; if (subject) LIST_PREPEND(JobDependency, subject, subject->subject_list, l); @@ -533,6 +534,14 @@ int job_finish_and_invalidate(Job *j, bool success) { other->meta.job->type == JOB_VERIFY_ACTIVE || other->meta.job->type == JOB_RELOAD_OR_START)) job_finish_and_invalidate(other->meta.job, false); + + SET_FOREACH(other, u->meta.dependencies[UNIT_CONFLICTED_BY], i) + if (!other->meta.ignore_dependency_failure && + other->meta.job && + (other->meta.job->type == JOB_START || + other->meta.job->type == JOB_VERIFY_ACTIVE || + other->meta.job->type == JOB_RELOAD_OR_START)) + job_finish_and_invalidate(other->meta.job, false); } }