summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-15 17:52:33 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-15 20:52:28 +0100
commit2d77603838b9dd86e6f8119c53df319a8606cf41 (patch)
treec24ef7b0f484b98da9a42bbd6cc40575afb1e00a /src
parent713a88757aec3a90f9b4bd67565aa42986400ebf (diff)
downloadsystemd-2d77603838b9dd86e6f8119c53df319a8606cf41.tar.gz
systemd-2d77603838b9dd86e6f8119c53df319a8606cf41.tar.bz2
systemd-2d77603838b9dd86e6f8119c53df319a8606cf41.zip
main: let's move ACTION_RUN test into initialize_runtime()
Let's hide this check inside the function and make it easier to follow the general control flow of main().
Diffstat (limited to 'src')
-rw-r--r--src/core/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/main.c b/src/core/main.c
index ccd35f19dd..4fd6f4edd6 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1917,6 +1917,9 @@ static int initialize_runtime(
* - Some only apply when we first start up, but not when we reexecute
*/
+ if (arg_action != ACTION_RUN)
+ return 0;
+
if (arg_system) {
/* Make sure we leave a core dump without panicing the kernel. */
install_crash_handler();
@@ -2479,14 +2482,12 @@ int main(int argc, char *argv[]) {
log_execution_mode(&first_boot);
- if (arg_action == ACTION_RUN) {
- r = initialize_runtime(skip_setup,
- &saved_rlimit_nofile,
- &saved_rlimit_memlock,
- &error_message);
- if (r < 0)
- goto finish;
- }
+ r = initialize_runtime(skip_setup,
+ &saved_rlimit_nofile,
+ &saved_rlimit_memlock,
+ &error_message);
+ if (r < 0)
+ goto finish;
r = manager_new(arg_system ? UNIT_FILE_SYSTEM : UNIT_FILE_USER,
arg_action == ACTION_TEST ? MANAGER_TEST_FULL : 0,