Loading init/host_init_stubs.h +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ inline uint32_t HandlePropertySet(const std::string&, const std::string&, const // reboot_utils.h inline void SetFatalRebootTarget() {} inline void __attribute__((noreturn)) InitFatalReboot() { inline void __attribute__((noreturn)) InitFatalReboot(int signal_number) { abort(); } Loading init/reboot_utils.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ void __attribute__((noreturn)) RebootSystem(unsigned int cmd, const std::string& abort(); } void __attribute__((noreturn)) InitFatalReboot() { void __attribute__((noreturn)) InitFatalReboot(int signal_number) { auto pid = fork(); if (pid == -1) { Loading @@ -124,6 +124,7 @@ void __attribute__((noreturn)) InitFatalReboot() { } // In the parent, let's try to get a backtrace then shutdown. LOG(ERROR) << __FUNCTION__ << ": signal " << signal_number; std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (!backtrace->Unwind(0)) { Loading Loading @@ -154,7 +155,7 @@ void InstallRebootSignalHandlers() { // RebootSystem uses syscall() which isn't actually async-signal-safe, but our only option // and probably good enough given this is already an error case and only enabled for // development builds. InitFatalReboot(); InitFatalReboot(signal); }; action.sa_flags = SA_RESTART; sigaction(SIGABRT, &action, nullptr); Loading init/reboot_utils.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ void SetFatalRebootTarget(); bool IsRebootCapable(); // This is a wrapper around the actual reboot calls. void __attribute__((noreturn)) RebootSystem(unsigned int cmd, const std::string& reboot_target); void __attribute__((noreturn)) InitFatalReboot(); void __attribute__((noreturn)) InitFatalReboot(int signal_number); void InstallRebootSignalHandlers(); } // namespace init Loading init/util.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <errno.h> #include <fcntl.h> #include <pwd.h> #include <signal.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> Loading Loading @@ -481,7 +482,7 @@ static void InitAborter(const char* abort_message) { return; } InitFatalReboot(); InitFatalReboot(SIGABRT); } // The kernel opens /dev/console and uses that fd for stdin/stdout/stderr if there is a serial Loading Loading
init/host_init_stubs.h +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ inline uint32_t HandlePropertySet(const std::string&, const std::string&, const // reboot_utils.h inline void SetFatalRebootTarget() {} inline void __attribute__((noreturn)) InitFatalReboot() { inline void __attribute__((noreturn)) InitFatalReboot(int signal_number) { abort(); } Loading
init/reboot_utils.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ void __attribute__((noreturn)) RebootSystem(unsigned int cmd, const std::string& abort(); } void __attribute__((noreturn)) InitFatalReboot() { void __attribute__((noreturn)) InitFatalReboot(int signal_number) { auto pid = fork(); if (pid == -1) { Loading @@ -124,6 +124,7 @@ void __attribute__((noreturn)) InitFatalReboot() { } // In the parent, let's try to get a backtrace then shutdown. LOG(ERROR) << __FUNCTION__ << ": signal " << signal_number; std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (!backtrace->Unwind(0)) { Loading Loading @@ -154,7 +155,7 @@ void InstallRebootSignalHandlers() { // RebootSystem uses syscall() which isn't actually async-signal-safe, but our only option // and probably good enough given this is already an error case and only enabled for // development builds. InitFatalReboot(); InitFatalReboot(signal); }; action.sa_flags = SA_RESTART; sigaction(SIGABRT, &action, nullptr); Loading
init/reboot_utils.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ void SetFatalRebootTarget(); bool IsRebootCapable(); // This is a wrapper around the actual reboot calls. void __attribute__((noreturn)) RebootSystem(unsigned int cmd, const std::string& reboot_target); void __attribute__((noreturn)) InitFatalReboot(); void __attribute__((noreturn)) InitFatalReboot(int signal_number); void InstallRebootSignalHandlers(); } // namespace init Loading
init/util.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <errno.h> #include <fcntl.h> #include <pwd.h> #include <signal.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> Loading Loading @@ -481,7 +482,7 @@ static void InitAborter(const char* abort_message) { return; } InitFatalReboot(); InitFatalReboot(SIGABRT); } // The kernel opens /dev/console and uses that fd for stdin/stdout/stderr if there is a serial Loading