summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-11 13:38:14 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-11 13:43:19 +0100
commitf1d075dcb7e931cf1e01f277305e531348a7dff2 (patch)
tree8a51029930bcf07c86dda07bd60db01160675e3f
parenthomed: replace "home directory" with "home area" in a few places (diff)
downloadsystemd-f1d075dcb7e931cf1e01f277305e531348a7dff2.tar.xz
systemd-f1d075dcb7e931cf1e01f277305e531348a7dff2.zip
core: shorten local variable names in do_queue_default_job()
There is really no risk of confusion here: it's a simple function that queues one job.
-rw-r--r--src/core/main.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/main.c b/src/core/main.c
index ac82c723ea..0f49dae73a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1995,21 +1995,21 @@ static int do_queue_default_job(
const char **ret_error_message) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- const char* default_unit;
- Job *default_unit_job;
- Unit *target = NULL;
+ const char *unit;
+ Job *job;
+ Unit *target;
int r;
if (arg_default_unit)
- default_unit = arg_default_unit;
+ unit = arg_default_unit;
else if (in_initrd())
- default_unit = SPECIAL_INITRD_TARGET;
+ unit = SPECIAL_INITRD_TARGET;
else
- default_unit = SPECIAL_DEFAULT_TARGET;
+ unit = SPECIAL_DEFAULT_TARGET;
- log_debug("Activating default unit: %s", default_unit);
+ log_debug("Activating default unit: %s", unit);
- r = manager_load_startable_unit_or_warn(m, default_unit, NULL, &target);
+ r = manager_load_startable_unit_or_warn(m, unit, NULL, &target);
if (r < 0 && in_initrd() && !arg_default_unit) {
/* Fall back to default.target, which we used to always use by default. Only do this if no
* explicit configuration was given. */
@@ -2031,13 +2031,13 @@ static int do_queue_default_job(
assert(target->load_state == UNIT_LOADED);
- r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, NULL, &error, &default_unit_job);
+ r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, NULL, &error, &job);
if (r == -EPERM) {
log_debug_errno(r, "Default target could not be isolated, starting instead: %s", bus_error_message(&error, r));
sd_bus_error_free(&error);
- r = manager_add_job(m, JOB_START, target, JOB_REPLACE, NULL, &error, &default_unit_job);
+ r = manager_add_job(m, JOB_START, target, JOB_REPLACE, NULL, &error, &job);
if (r < 0) {
*ret_error_message = "Failed to start default target";
return log_emergency_errno(r, "Failed to start default target: %s", bus_error_message(&error, r));
@@ -2048,7 +2048,7 @@ static int do_queue_default_job(
return log_emergency_errno(r, "Failed to isolate default target: %s", bus_error_message(&error, r));
}
- m->default_unit_job_id = default_unit_job->id;
+ m->default_unit_job_id = job->id;
return 0;
}