diff --git a/minzip/Zip.c b/minzip/Zip.c
index a601e74..8cdb898 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -12,7 +12,6 @@
 #include <stdint.h>     // for uintptr_t
 #include <stdlib.h>
 #include <sys/stat.h>   // for S_ISLNK()
-#include <sys/statfs.h>
 #include <unistd.h>
 
 #define LOG_TAG "minzip"
@@ -85,12 +84,6 @@
 };
 
 
-/* The maximum zipped file write size we will align. */
-#define WRITE_SIZE  32768
-/* The boundary on which we will align it. */
-#define WRITE_ALIGNMENT 32768
-
-
 /*
  * For debugging, dump the contents of a ZipEntry.
  */
@@ -779,36 +772,18 @@
 static bool writeProcessFunction(const unsigned char *data, int dataLen,
                                  void *cookie)
 {
-    WriteInfo *wi = (WriteInfo*)cookie;
-
-    if (dataLen <= WRITE_SIZE) {
-        memcpy(wi->aligned_buffer, data, dataLen);
-        data = wi->aligned_buffer;
-    }
+    int fd = (int)cookie;
 
     ssize_t soFar = 0;
     while (true) {
-        ssize_t n = write(wi->fd, data+soFar, dataLen-soFar);
+        ssize_t n = write(fd, data+soFar, dataLen-soFar);
         if (n <= 0) {
             LOGE("Error writing %ld bytes from zip file from %p: %s\n",
                  dataLen-soFar, data+soFar, strerror(errno));
-            if (errno == ENOSPC) {
-                struct statfs sf;
-                if (statfs("/system", &sf) != 0) {
-                    LOGE("failed to statfs /system: %s\n", strerror(errno));
-                } else {
-                    LOGE("statfs said: %ld * %ld = %ld\n",
-                         (long)sf.f_bsize, (long)sf.f_bfree,
-                         (long)sf.f_bsize * (long)sf.f_bfree);
-                }
+            if (errno != EINTR) {
+              return false;
             }
-            return false;
         } else if (n > 0) {
-            if (n < dataLen-soFar) {
-                LOGE("short write: %d bytes of %d from %p\n",
-                     (int)n, (int)(dataLen-soFar),
-                     data+soFar);
-            }
             soFar += n;
             if (soFar == dataLen) return true;
             if (soFar > dataLen) {
@@ -824,10 +799,10 @@
  * Uncompress "pEntry" in "pArchive" to "fd" at the current offset.
  */
 bool mzExtractZipEntryToFile(const ZipArchive *pArchive,
-    const ZipEntry *pEntry, WriteInfo *wi)
+    const ZipEntry *pEntry, int fd)
 {
     bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction,
-                                         wi);
+                                         (void*)fd);
     if (!ret) {
         LOGE("Can't extract entry to file.\n");
         return false;
@@ -929,11 +904,6 @@
         return false;
     }
 
-    unsigned char* buffer = malloc(WRITE_SIZE+WRITE_ALIGNMENT);
-    WriteInfo wi;
-    wi.aligned_buffer = buffer + WRITE_ALIGNMENT -
-            ((long)buffer % WRITE_ALIGNMENT);
-
     unsigned int zipDirLen;
     char *zpath;
 
@@ -1114,8 +1084,7 @@
                     break;
                 }
 
-                wi.fd = fd;
-                bool ok = mzExtractZipEntryToFile(pArchive, pEntry, &wi);
+                bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd);
                 close(fd);
                 if (!ok) {
                     LOGE("Error extracting \"%s\"\n", targetFile);
@@ -1138,7 +1107,6 @@
 
     free(helper.buf);
     free(zpath);
-    free(buffer);
 
     return ok;
 }
