diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-15 16:49:43 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-15 20:52:28 +0100 |
commit | 5a2e0c6257a49a8a1d6b60b33c766f4ca96ade54 (patch) | |
tree | bef9809755eb24473587bf3dc32fe6f000fffd24 /src | |
parent | 6f101b566f35ae2d9c9529961d64b1ca9623989e (diff) | |
download | systemd-5a2e0c6257a49a8a1d6b60b33c766f4ca96ade54.tar.gz systemd-5a2e0c6257a49a8a1d6b60b33c766f4ca96ade54.tar.bz2 systemd-5a2e0c6257a49a8a1d6b60b33c766f4ca96ade54.zip |
main: move chdir("/") a bit earlier
There's no need to do this within the block where logging is closed,
hence move it earlier, so that this block can be kept as small as
possible.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c index c3d0c01772..66270d4e0d 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2405,6 +2405,9 @@ int main(int argc, char *argv[]) { assert_se(IN_SET(arg_action, ACTION_RUN, ACTION_TEST)); + /* Move out of the way, so that we won't block unmounts */ + assert_se(chdir("/") == 0); + /* Close logging fds, in order not to confuse fdset below */ log_close(); @@ -2426,9 +2429,6 @@ int main(int argc, char *argv[]) { setsid(); } - /* Move out of the way, so that we won't block unmounts */ - assert_se(chdir("/") == 0); - /* Reset the console, but only if this is really init and we * are freshly booted */ if (arg_system && arg_action == ACTION_RUN) { |