diff options
author | Tom Cherry <tomcherry@google.com> | 2017-03-16 18:08:56 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-03-17 10:58:17 -0700 |
commit | 34e70410ee70a0e95ab8318636000e8e28554fe1 (patch) | |
tree | 51cb44fd76770e116bdbab35572c7905e26a6104 /debuggerd/client/debuggerd_client_test.cpp | |
parent | e323976e747c28b78b5e1be565317f500e0f5c06 (diff) |
init: cleanup is_first_stage conditionals
A recent change to the is_first_stage conditionals created a unneeded
else { } block as both the code in the else { } block and any code
that runs after it are both in the second stage of init. A first step
to clean this up is to remove this else block.
Secondly, given the above confusion, it makes sense to simplify the two
if (is_first_stage) conditions into one, which only now requires
duplicating one line to initialize logging and the actual "init
first/second stage started!" logs.
Lastly, there are a few commands ran at the beginning of both init
stages that do not need to be,
* boot_clock::time_point start_time = boot_clock::now();
This is only used in the first stage so keep it there
* umask(0);
umasks are preserved across execve() so it only needs to be set in the
first stage
* chmod("/proc/cmdline", 0440);
This needs to be moved until after /proc is mounted in the first
stage, but otherwise only needs to be done once
Test: Boot bullhead, check umask, check cmdline permissions, check
boot time property
Change-Id: Idb7df1d4330960ce282d9609f5c62281ee2638b9
Diffstat (limited to 'debuggerd/client/debuggerd_client_test.cpp')
0 files changed, 0 insertions, 0 deletions