init: add [[nodiscard]] to Result
It's better to either check these results or explicitly ignore them.
Only a few callers weren't already doing this, so it's relatively
trivial to enforce.
Test: build
Change-Id: I44cdc342e46128f66cac914aaa0b9b4559cacd8c
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 17d34e1..7da2526 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -1018,7 +1018,11 @@
if (siginfo.si_code != CLD_EXITED || siginfo.si_status != 0) {
if (e4crypt_is_native()) {
LOG(ERROR) << "Rebooting into recovery, reason: " << reboot_reason;
- reboot_into_recovery({"--prompt_and_wipe_data", "--reason="s + reboot_reason});
+ if (auto result = reboot_into_recovery(
+ {"--prompt_and_wipe_data", "--reason="s + reboot_reason});
+ !result) {
+ LOG(FATAL) << "Could not reboot into recovery: " << result.error();
+ }
} else {
LOG(ERROR) << "Failure (reboot suppressed): " << reboot_reason;
}