X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=manager.c;h=90e17b2497078cd38905649790aac69efedd9969;hp=7d24494b2b979a90026260a2fd78f56ac8a29d9b;hb=44d8db9e5aa86165c97289f6c78a7e42bac78362;hpb=75787bb7136e064ee623aaee00ec76a7f024c91a;ds=sidebyside diff --git a/manager.c b/manager.c index 7d24494b2..90e17b249 100644 --- a/manager.c +++ b/manager.c @@ -134,7 +134,12 @@ static void transaction_find_jobs_that_matter_to_anchor(Manager *m, Job *j, unsi * indirectly a dependency of the anchor job via paths that * are fully marked as mattering. */ - for (l = j ? j->subject_list : m->transaction_anchor; l; l = l->subject_next) { + if (j) + l = j->subject_list; + else + l = m->transaction_anchor; + + LIST_FOREACH(subject, l, l) { /* This link does not matter */ if (!l->matters) @@ -169,7 +174,7 @@ static void transaction_merge_and_delete_job(Manager *m, Job *j, Job *other, Job /* Patch us in as new owner of the JobDependency objects */ last = NULL; - for (l = other->subject_list; l; l = l->subject_next) { + LIST_FOREACH(subject, l, other->subject_list) { assert(l->subject == other); l->subject = j; last = l; @@ -185,7 +190,7 @@ static void transaction_merge_and_delete_job(Manager *m, Job *j, Job *other, Job /* Patch us in as new owner of the JobDependency objects */ last = NULL; - for (l = other->object_list; l; l = l->object_next) { + LIST_FOREACH(object, l, other->object_list) { assert(l->object == other); l->object = j; last = l;