Merge "Revert "Force sync files written by minzip."" into android-5.1
diff --git a/minzip/Zip.c b/minzip/Zip.c
index 70aff00..5070104 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -1067,8 +1067,7 @@
                     setfscreatecon(secontext);
                 }
 
-                int fd = open(targetFile, O_CREAT|O_WRONLY|O_TRUNC|O_SYNC
-                        , UNZIP_FILEMODE);
+                int fd = creat(targetFile, UNZIP_FILEMODE);
 
                 if (secontext) {
                     freecon(secontext);
@@ -1083,12 +1082,7 @@
                 }
 
                 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd);
-                if (ok) {
-                    ok = (fsync(fd) == 0);
-                }
-                if (close(fd) != 0) {
-                    ok = false;
-                }
+                close(fd);
                 if (!ok) {
                     LOGE("Error extracting \"%s\"\n", targetFile);
                     ok = false;