diff options
author | Johan Harvyl <johan.harvyl@sonymobile.com> | 2016-08-09 21:50:15 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-09 21:50:15 +0200 |
commit | a550ee0df7abe3e090cea2570ec9c302856bc72f (patch) | |
tree | 1ba2f46b00326f71c9ef9c3ad144aac4153b0dde | |
parent | Merge "Fix references to libcrypto_utils_static." (diff) | |
parent | Merge "Handle error from fopen_path in finish_recovery" (diff) | |
download | android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar.gz android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar.bz2 android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar.lz android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar.xz android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.tar.zst android_bootable_recovery-a550ee0df7abe3e090cea2570ec9c302856bc72f.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); + } } } |