summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Harvyl <johan.harvyl@sonymobile.com>2016-08-05 15:42:59 +0200
committerJohan Redestig <johan.redestig@sonymobile.com>2016-08-08 08:28:30 +0200
commit8569142147f8ba7ec6a3431f96aa00d66b45db61 (patch)
treec2f0d66fee901caecd5954f4d2b0aea101be4264
parentMerge "Further compress the text images with zopflipng" (diff)
downloadandroid_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar.gz
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar.bz2
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar.lz
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar.xz
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.tar.zst
android_bootable_recovery-8569142147f8ba7ec6a3431f96aa00d66b45db61.zip
Diffstat (limited to '')
-rw-r--r--recovery.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 28dd212ba..7bdf961e7 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -504,10 +504,12 @@ finish_recovery() {
if (has_cache) {
LOGI("Saving locale \"%s\"\n", locale);
FILE* fp = fopen_path(LOCALE_FILE, "w");
- fwrite(locale, 1, len, fp);
- fflush(fp);
- fsync(fileno(fp));
- check_and_fclose(fp, LOCALE_FILE);
+ if (fp != NULL) {
+ fwrite(locale, 1, len, fp);
+ fflush(fp);
+ fsync(fileno(fp));
+ check_and_fclose(fp, LOCALE_FILE);
+ }
}
}