diff options
| author | 2022-10-14 22:30:25 +0000 | |
|---|---|---|
| committer | 2022-10-14 22:30:25 +0000 | |
| commit | 4b75f783e8df89f0ef2ecb0fe6cae93ed207ca6d (patch) | |
| tree | f0ca3f43960c59724c38d5f548a91ff9ca2a0aa7 | |
| parent | 2d1f4371944bb7f853f4eaf36edce38a95657fdb (diff) | |
| parent | f5351ea3a2198c8c3b9cc15561d4f90a7ed94d8d (diff) | |
Merge "add fsync when copy native libs" am: 32ad6e6d7f am: d49c7332a8 am: f5351ea3a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2252338
Change-Id: I007daa216e17c08b07f868db5b47b28610b3bbaa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/jni/com_android_internal_content_NativeLibraryHelper.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index acf4da6a5d07..2cd9f8966bb2 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -257,6 +257,13 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr return INSTALL_FAILED_CONTAINER_ERROR; } + if (fsync(fd) < 0) { + ALOGE("Coulnd't fsync temporary file name: %s: %s\n", localTmpFileName, strerror(errno)); + close(fd); + unlink(localTmpFileName); + return INSTALL_FAILED_INTERNAL_ERROR; + } + close(fd); // Set the modification time for this file to the ZIP's mod time. |