From 4f33e55d1c38d2f72f3306a82c177850f3676408 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Thu, 23 Aug 2012 13:16:12 -0700 Subject: change recovery images to android with spinner Also make writing the locale a bit more robust. Change-Id: I803dd0aa0b9d6661fad74ea13fb085682402323c --- recovery.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'recovery.cpp') diff --git a/recovery.cpp b/recovery.cpp index e374c7d5a..70817d307 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -277,6 +277,18 @@ finish_recovery(const char *send_intent) { } } + // Save the locale to cache, so if recovery is next started up + // without a --locale argument (eg, directly from the bootloader) + // it will use the last-known locale. + if (locale != NULL) { + LOGI("Saving locale \"%s\"\n", locale); + FILE* fp = fopen_path(LOCALE_FILE, "w"); + fwrite(locale, 1, strlen(locale), fp); + fflush(fp); + fsync(fileno(fp)); + check_and_fclose(fp, LOCALE_FILE); + } + // Copy logs to cache so the system can find out what happened. copy_log_file(TEMPORARY_LOG_FILE, LOG_FILE, true); copy_log_file(TEMPORARY_LOG_FILE, LAST_LOG_FILE, false); @@ -286,15 +298,6 @@ finish_recovery(const char *send_intent) { chmod(LAST_LOG_FILE, 0640); chmod(LAST_INSTALL_FILE, 0644); - // Save the locale to cache, so if recovery is next started up - // without a --locale argument (eg, directly from the bootloader) - // it will use the last-known locale. - if (locale != NULL) { - FILE* fp = fopen(LOCALE_FILE, "w"); - fwrite(locale, 1, strlen(locale), fp); - fclose(fp); - } - // Reset to normal system boot so recovery won't cycle indefinitely. struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); -- cgit v1.2.3