Skip to content

Commit fb44a4a

Browse files
yuwatabluca
authored andcommitted
core/transaction: rename ret -> job
(cherry picked from commit fc49b29) (cherry picked from commit 74682088723f62424ab6ad7e219d9e6ecbc51c38) (cherry picked from commit c41a1c28c6af28ee05097296518aa6ea2221b288) (cherry picked from commit e038fdd)
1 parent 62caea3 commit fb44a4a

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/core/transaction.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ int transaction_add_job_and_dependencies(
947947
sd_bus_error *e) {
948948

949949
bool is_new;
950-
Job *ret;
950+
Job *job;
951951
int r;
952952

953953
assert(tr);
@@ -1000,21 +1000,21 @@ int transaction_add_job_and_dependencies(
10001000
job_type_to_string(type), unit->id);
10011001

10021002
/* First add the job. */
1003-
ret = transaction_add_one_job(tr, type, unit, &is_new);
1004-
if (!ret)
1003+
job = transaction_add_one_job(tr, type, unit, &is_new);
1004+
if (!job)
10051005
return -ENOMEM;
10061006

10071007
if (FLAGS_SET(flags, TRANSACTION_IGNORE_ORDER))
1008-
ret->ignore_order = true;
1008+
job->ignore_order = true;
10091009

10101010
/* Then, add a link to the job. */
10111011
if (by) {
1012-
if (!job_dependency_new(by, ret, FLAGS_SET(flags, TRANSACTION_MATTERS), FLAGS_SET(flags, TRANSACTION_CONFLICTS)))
1012+
if (!job_dependency_new(by, job, FLAGS_SET(flags, TRANSACTION_MATTERS), FLAGS_SET(flags, TRANSACTION_CONFLICTS)))
10131013
return -ENOMEM;
10141014
} else {
10151015
/* If the job has no parent job, it is the anchor job. */
10161016
assert(!tr->anchor_job);
1017-
tr->anchor_job = ret;
1017+
tr->anchor_job = job;
10181018
}
10191019

10201020
if (!is_new || FLAGS_SET(flags, TRANSACTION_IGNORE_REQUIREMENTS) || type == JOB_NOP)
@@ -1024,9 +1024,9 @@ int transaction_add_job_and_dependencies(
10241024
Unit *dep;
10251025

10261026
/* If we are following some other unit, make sure we add all dependencies of everybody following. */
1027-
if (unit_following_set(ret->unit, &following) > 0)
1027+
if (unit_following_set(job->unit, &following) > 0)
10281028
SET_FOREACH(dep, following) {
1029-
r = transaction_add_job_and_dependencies(tr, type, dep, ret, flags & TRANSACTION_IGNORE_ORDER, e);
1029+
r = transaction_add_job_and_dependencies(tr, type, dep, job, flags & TRANSACTION_IGNORE_ORDER, e);
10301030
if (r < 0) {
10311031
log_unit_full_errno(dep, r == -ERFKILL ? LOG_INFO : LOG_WARNING, r,
10321032
"Cannot add dependency job, ignoring: %s",
@@ -1037,8 +1037,8 @@ 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, ret->unit, UNIT_ATOM_PULL_IN_START) {
1041-
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER), e);
1040+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PULL_IN_START) {
1041+
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 */
10441044
goto fail;
@@ -1047,8 +1047,8 @@ int transaction_add_job_and_dependencies(
10471047
}
10481048
}
10491049

1050-
UNIT_FOREACH_DEPENDENCY(dep, ret->unit, UNIT_ATOM_PULL_IN_START_IGNORED) {
1051-
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, flags & TRANSACTION_IGNORE_ORDER, e);
1050+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PULL_IN_START_IGNORED) {
1051+
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
10541054
* as errors. */
@@ -1060,8 +1060,8 @@ int transaction_add_job_and_dependencies(
10601060
}
10611061
}
10621062

1063-
UNIT_FOREACH_DEPENDENCY(dep, ret->unit, UNIT_ATOM_PULL_IN_VERIFY) {
1064-
r = transaction_add_job_and_dependencies(tr, JOB_VERIFY_ACTIVE, dep, ret, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER), e);
1063+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PULL_IN_VERIFY) {
1064+
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 */
10671067
goto fail;
@@ -1070,8 +1070,8 @@ int transaction_add_job_and_dependencies(
10701070
}
10711071
}
10721072

1073-
UNIT_FOREACH_DEPENDENCY(dep, ret->unit, UNIT_ATOM_PULL_IN_STOP) {
1074-
r = transaction_add_job_and_dependencies(tr, JOB_STOP, dep, ret, TRANSACTION_MATTERS | TRANSACTION_CONFLICTS | (flags & TRANSACTION_IGNORE_ORDER), e);
1073+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PULL_IN_STOP) {
1074+
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 */
10771077
goto fail;
@@ -1080,8 +1080,8 @@ int transaction_add_job_and_dependencies(
10801080
}
10811081
}
10821082

1083-
UNIT_FOREACH_DEPENDENCY(dep, ret->unit, UNIT_ATOM_PULL_IN_STOP_IGNORED) {
1084-
r = transaction_add_job_and_dependencies(tr, JOB_STOP, dep, ret, flags & TRANSACTION_IGNORE_ORDER, e);
1083+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PULL_IN_STOP_IGNORED) {
1084+
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,
10871087
"Cannot add dependency job, ignoring: %s",
@@ -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, ret->unit, is_stop ? UNIT_ATOM_PROPAGATE_STOP : UNIT_ATOM_PROPAGATE_RESTART) {
1097+
UNIT_FOREACH_DEPENDENCY(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;
@@ -1103,7 +1103,7 @@ int transaction_add_job_and_dependencies(
11031103
if (nt == JOB_NOP)
11041104
continue;
11051105

1106-
r = transaction_add_job_and_dependencies(tr, nt, dep, ret, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER), e);
1106+
r = transaction_add_job_and_dependencies(tr, nt, dep, job, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER), e);
11071107
if (r < 0) {
11081108
if (r != -EBADR) /* job type not applicable */
11091109
return r;
@@ -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, ret->unit, UNIT_ATOM_PROPAGATE_STOP_GRACEFUL) {
1119+
UNIT_FOREACH_DEPENDENCY(dep, job->unit, UNIT_ATOM_PROPAGATE_STOP_GRACEFUL) {
11201120
JobType nt;
11211121
Job *j;
11221122

@@ -1126,7 +1126,7 @@ int transaction_add_job_and_dependencies(
11261126
if (nt == JOB_NOP)
11271127
continue;
11281128

1129-
r = transaction_add_job_and_dependencies(tr, nt, dep, ret, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER) | TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL, e);
1129+
r = transaction_add_job_and_dependencies(tr, nt, dep, job, TRANSACTION_MATTERS | (flags & TRANSACTION_IGNORE_ORDER) | TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL, e);
11301130
if (r < 0) {
11311131
if (r != -EBADR) /* job type not applicable */
11321132
return r;
@@ -1137,7 +1137,7 @@ int transaction_add_job_and_dependencies(
11371137
}
11381138

11391139
if (type == JOB_RELOAD)
1140-
transaction_add_propagate_reload_jobs(tr, ret->unit, ret, flags & TRANSACTION_IGNORE_ORDER);
1140+
transaction_add_propagate_reload_jobs(tr, job->unit, job, flags & TRANSACTION_IGNORE_ORDER);
11411141

11421142
/* JOB_VERIFY_ACTIVE requires no dependency handling */
11431143

@@ -1148,7 +1148,7 @@ int transaction_add_job_and_dependencies(
11481148
log_unit_debug_errno(unit, r, "Cannot add dependency job to transaction, deleting job %s/%s again: %s",
11491149
unit->id, job_type_to_string(type), bus_error_message(e, r));
11501150

1151-
transaction_delete_job(tr, ret, /* delete_dependencies= */ false);
1151+
transaction_delete_job(tr, job, /* delete_dependencies= */ false);
11521152
return r;
11531153
}
11541154

0 commit comments

Comments
 (0)