@@ -892,7 +892,7 @@ void transaction_add_propagate_reload_jobs(
892892 assert (tr );
893893 assert (unit );
894894
895- UNIT_FOREACH_DEPENDENCY (dep , unit , UNIT_ATOM_PROPAGATES_RELOAD_TO ) {
895+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , unit , UNIT_ATOM_PROPAGATES_RELOAD_TO ) {
896896 _cleanup_ (sd_bus_error_free ) sd_bus_error e = SD_BUS_ERROR_NULL ;
897897
898898 nt = job_type_collapse (JOB_TRY_RELOAD , dep );
@@ -1037,7 +1037,7 @@ int transaction_add_job_and_dependencies(
10371037
10381038 /* Finally, recursively add in all dependencies. */
10391039 if (IN_SET (type , JOB_START , JOB_RESTART )) {
1040- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PULL_IN_START ) {
1040+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PULL_IN_START ) {
10411041 r = transaction_add_job_and_dependencies (tr , JOB_START , dep , job , TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER ), e );
10421042 if (r < 0 ) {
10431043 if (r != - EBADR ) /* job type not applicable */
@@ -1047,7 +1047,7 @@ int transaction_add_job_and_dependencies(
10471047 }
10481048 }
10491049
1050- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PULL_IN_START_IGNORED ) {
1050+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PULL_IN_START_IGNORED ) {
10511051 r = transaction_add_job_and_dependencies (tr , JOB_START , dep , job , flags & TRANSACTION_IGNORE_ORDER , e );
10521052 if (r < 0 ) {
10531053 /* unit masked, job type not applicable and unit not found are not considered
@@ -1060,7 +1060,7 @@ int transaction_add_job_and_dependencies(
10601060 }
10611061 }
10621062
1063- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PULL_IN_VERIFY ) {
1063+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PULL_IN_VERIFY ) {
10641064 r = transaction_add_job_and_dependencies (tr , JOB_VERIFY_ACTIVE , dep , job , TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER ), e );
10651065 if (r < 0 ) {
10661066 if (r != - EBADR ) /* job type not applicable */
@@ -1070,7 +1070,7 @@ int transaction_add_job_and_dependencies(
10701070 }
10711071 }
10721072
1073- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PULL_IN_STOP ) {
1073+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PULL_IN_STOP ) {
10741074 r = transaction_add_job_and_dependencies (tr , JOB_STOP , dep , job , TRANSACTION_MATTERS | TRANSACTION_CONFLICTS | (flags & TRANSACTION_IGNORE_ORDER ), e );
10751075 if (r < 0 ) {
10761076 if (r != - EBADR ) /* job type not applicable */
@@ -1080,7 +1080,7 @@ int transaction_add_job_and_dependencies(
10801080 }
10811081 }
10821082
1083- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PULL_IN_STOP_IGNORED ) {
1083+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PULL_IN_STOP_IGNORED ) {
10841084 r = transaction_add_job_and_dependencies (tr , JOB_STOP , dep , job , flags & TRANSACTION_IGNORE_ORDER , e );
10851085 if (r < 0 ) {
10861086 log_unit_warning (dep ,
@@ -1094,7 +1094,7 @@ int transaction_add_job_and_dependencies(
10941094 if (IN_SET (type , JOB_RESTART , JOB_STOP ) || (type == JOB_START && FLAGS_SET (flags , TRANSACTION_PROPAGATE_START_AS_RESTART ))) {
10951095 bool is_stop = type == JOB_STOP ;
10961096
1097- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , is_stop ? UNIT_ATOM_PROPAGATE_STOP : UNIT_ATOM_PROPAGATE_RESTART ) {
1097+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , is_stop ? UNIT_ATOM_PROPAGATE_STOP : UNIT_ATOM_PROPAGATE_RESTART ) {
10981098 /* We propagate RESTART only as TRY_RESTART, in order not to start dependencies that
10991099 * are not around. */
11001100 JobType nt ;
@@ -1116,7 +1116,7 @@ int transaction_add_job_and_dependencies(
11161116 * all other dependencies are processed, i.e. we're the anchor job or already in the recursion
11171117 * that handles it. */
11181118 if (!by || FLAGS_SET (flags , TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL ))
1119- UNIT_FOREACH_DEPENDENCY (dep , job -> unit , UNIT_ATOM_PROPAGATE_STOP_GRACEFUL ) {
1119+ UNIT_FOREACH_DEPENDENCY_SAFE (dep , job -> unit , UNIT_ATOM_PROPAGATE_STOP_GRACEFUL ) {
11201120 JobType nt ;
11211121 Job * j ;
11221122
@@ -1214,7 +1214,7 @@ int transaction_add_triggering_jobs(Transaction *tr, Unit *u) {
12141214 assert (tr );
12151215 assert (u );
12161216
1217- UNIT_FOREACH_DEPENDENCY (trigger , u , UNIT_ATOM_TRIGGERED_BY ) {
1217+ UNIT_FOREACH_DEPENDENCY_SAFE (trigger , u , UNIT_ATOM_TRIGGERED_BY ) {
12181218 _cleanup_ (sd_bus_error_free ) sd_bus_error e = SD_BUS_ERROR_NULL ;
12191219
12201220 /* No need to stop inactive jobs */
0 commit comments