diff --git a/init/host_init_verifier.cpp b/init/host_init_verifier.cpp index f070776ec..662185c44 100644 --- a/init/host_init_verifier.cpp +++ b/init/host_init_verifier.cpp @@ -108,9 +108,9 @@ passwd* getpwnam(const char* login) { // NOLINT: implementing bad function. static passwd static_passwd = { .pw_name = static_name, .pw_dir = static_dir, - .pw_shell = static_shell, .pw_uid = 0, .pw_gid = 0, + .pw_shell = static_shell, }; for (size_t n = 0; n < android_id_count; ++n) { diff --git a/init/init.cpp b/init/init.cpp index 40e21696f..19f34dabb 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -751,7 +751,7 @@ static void UnblockSignals() { static void InstallSignalFdHandler(Epoll* epoll) { // Applying SA_NOCLDSTOP to a defaulted SIGCHLD handler prevents the signalfd from receiving // SIGCHLD when a child process stops or continues (b/77867680#comment9). - const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP }; + const struct sigaction act { .sa_flags = SA_NOCLDSTOP, .sa_handler = SIG_DFL }; sigaction(SIGCHLD, &act, nullptr); sigset_t mask; diff --git a/init/sigchld_handler.cpp b/init/sigchld_handler.cpp index f8c501f8a..0901a960f 100644 --- a/init/sigchld_handler.cpp +++ b/init/sigchld_handler.cpp @@ -139,10 +139,10 @@ void WaitToBeReaped(const std::vector& pids, std::chrono::milliseconds ti } LOG(INFO) << "Waiting for " << pids.size() << " pids to be reaped took " << t << " with " << alive_pids.size() << " of them still running"; - for (pid_t pid : pids) { + for (pid_t pid : alive_pids) { std::string status = "(no-such-pid)"; ReadFileToString(StringPrintf("/proc/%d/status", pid), &status); - LOG(INFO) << "Still running: " << pid << ' ' << status; + LOG(INFO) << "Still running: " << pid << '\n' << status; } }