init: replace panic() with LOG(FATAL)
Test: boot bullhead
Test: Introduce LOG(FATAL) at various points of init and ensure that
it reboots to the bootloader successfully
Test: Introduce LOG(FATAL) during DoReboot() and ensure that it reboots
instead of recursing infinitely
Test: Ensure that fatal signals reboot to bootloader
Change-Id: I409005b6fab379df2d635e3e33d2df48a1a97df3
diff --git a/init/reboot.cpp b/init/reboot.cpp
index 24ccdfc..e2453c3 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -191,8 +191,7 @@
return value == CAP_SET;
}
-static void __attribute__((noreturn))
-RebootSystem(unsigned int cmd, const std::string& rebootTarget) {
+void __attribute__((noreturn)) RebootSystem(unsigned int cmd, const std::string& rebootTarget) {
LOG(INFO) << "Reboot ending, jumping to kernel";
if (!IsRebootCapable()) {
@@ -216,7 +215,7 @@
break;
}
// In normal case, reboot should not return.
- PLOG(FATAL) << "reboot call returned";
+ PLOG(ERROR) << "reboot call returned";
abort();
}