Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d49c7332 authored by Song Chun Fan's avatar Song Chun Fan Committed by Automerger Merge Worker
Browse files

Merge "add fsync when copy native libs" am: 32ad6e6d

parents 37f46d5b 32ad6e6d
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -260,6 +260,13 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
        return INSTALL_FAILED_CONTAINER_ERROR;
        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);
    close(fd);


    // Set the modification time for this file to the ZIP's mod time.
    // Set the modification time for this file to the ZIP's mod time.