diff options
| author | Danesh M <daneshm90@gmail.com> | 2011-11-25 20:53:19 -0500 |
|---|---|---|
| committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-07-10 22:45:28 +0100 |
| commit | 44070145d28aae267b1c31f74d96cc2c2d4770d8 (patch) | |
| tree | 5c1c07fb880d767393adae719d96191c6294b928 | |
| parent | 6456a4b853463003bc20bcf5a0aec37bd16fa31d (diff) | |
| download | system_core-44070145d28aae267b1c31f74d96cc2c2d4770d8.tar.gz system_core-44070145d28aae267b1c31f74d96cc2c2d4770d8.tar.bz2 system_core-44070145d28aae267b1c31f74d96cc2c2d4770d8.zip | |
libcutils : reboot mount fix
On aries for eg, cache needs to be rw for the RECOVERY_PRE_COMMAND to
work because we write to /cache/.startrecovery
This patchset moves the RECOVERY_PRE_COMMAND prior to the remount.
Change-Id: Iab1da9a15e64e8831b04e4eb21d824de5f8bd0eb
| -rw-r--r-- | libcutils/android_reboot.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libcutils/android_reboot.c b/libcutils/android_reboot.c index c6d30522..be71d8af 100644 --- a/libcutils/android_reboot.c +++ b/libcutils/android_reboot.c @@ -105,6 +105,13 @@ int android_reboot(int cmd, int flags, char *arg) { int ret; +#ifdef RECOVERY_PRE_COMMAND + if (cmd == ANDROID_RB_RESTART2) { + if (!strncmp((char *)arg,"recovery",8)) + system( RECOVERY_PRE_COMMAND ); + } +#endif + if (!(flags & ANDROID_RB_FLAG_NO_SYNC)) sync(); @@ -121,10 +128,6 @@ int android_reboot(int cmd, int flags, char *arg) break; case ANDROID_RB_RESTART2: -#ifdef RECOVERY_PRE_COMMAND - if (!strncmp((char *)arg,"recovery",8)) - system( RECOVERY_PRE_COMMAND ); -#endif ret = __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, arg); break; |
