summaryrefslogtreecommitdiffstats
path: root/uncrypt/uncrypt.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-05-28 01:49:09 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-28 01:49:09 +0200
commitd026a28c22dfb15728b6db88d5b8e9b093de2fd7 (patch)
tree1740d5e309610ce3dc8c808b508450ff6eb34009 /uncrypt/uncrypt.cpp
parentam 7b126d77: am 73151b51: Merge "recovery: change the way of rebooting when using power key combo" (diff)
parentam f272b9e7: Merge "Clean up the sleep()\'s after poking init services" (diff)
downloadandroid_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar.gz
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar.bz2
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar.lz
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar.xz
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.tar.zst
android_bootable_recovery-d026a28c22dfb15728b6db88d5b8e9b093de2fd7.zip
Diffstat (limited to 'uncrypt/uncrypt.cpp')
-rw-r--r--uncrypt/uncrypt.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp
index 11766f14c..d71271d8e 100644
--- a/uncrypt/uncrypt.cpp
+++ b/uncrypt/uncrypt.cpp
@@ -40,18 +40,20 @@
// file data to use as an update package.
#include <errno.h>
+#include <fcntl.h>
+#include <linux/fs.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/fs.h>
#include <sys/mman.h>
+#include <unistd.h>
#define LOG_TAG "uncrypt"
#include <log/log.h>
+#include <cutils/android_reboot.h>
#include <cutils/properties.h>
#include <fs_mgr.h>
@@ -376,7 +378,9 @@ static void wipe_misc() {
static void reboot_to_recovery() {
ALOGI("rebooting to recovery");
property_set("sys.powerctl", "reboot,recovery");
- sleep(10);
+ while (true) {
+ pause();
+ }
ALOGE("reboot didn't succeed?");
}