1. seandroid
  2. Untitled project
  3. bootable/recovery

Commits

Elliott Hughes  committed c86f22c

Pass the correct pointer to munmap on failure.

This won't ever happen, and you're probably screwed anyway if it
does, but that's no excuse...

Change-Id: I2c56f607e351e84308a72b41b834d13aaa98fc62

  • Participants
  • Parent commits 27f3160
  • Branches master

Comments (0)

Files changed (1)

File minzip/SysUtil.c

View file
     if (memPtr == NULL)
         return -1;
 
-    actual = read(fd, memPtr, length);
+    pMap->baseAddr = pMap->addr = memPtr;
+    pMap->baseLength = pMap->length = length;
+
+    actual = TEMP_FAILURE_RETRY(read(fd, memPtr, length));
     if (actual != length) {
         LOGE("only read %d of %d bytes\n", (int) actual, (int) length);
         sysReleaseShmem(pMap);
         return -1;
     }
 
-    pMap->baseAddr = pMap->addr = memPtr;
-    pMap->baseLength = pMap->length = length;
-
     return 0;
 }