diff options
author | Johan Harvyl <johan.harvyl@sonymobile.com> | 2016-08-09 21:55:43 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-09 21:55:43 +0200 |
commit | b33a6f8342b35a514bee6d434f440c65f956d9c7 (patch) | |
tree | e0eade123719a6d8254b618cbdca4979698bcfca | |
parent | Merge "Fix references to libcrypto_utils_static." am: b97da5e0f0 (diff) | |
parent | Merge "Handle error from fopen_path in finish_recovery" (diff) | |
download | android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar.gz android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar.bz2 android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar.lz android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar.xz android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.tar.zst android_bootable_recovery-b33a6f8342b35a514bee6d434f440c65f956d9c7.zip |
Diffstat (limited to '')
-rw-r--r-- | recovery.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp index a3c4053c1..88fedc857 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -510,10 +510,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); + } } } |