Commits

Anonymous committed 9028fb4 Merge

Merge "Pass the correct pointer to munmap on failure."

Comments (0)

Files changed (1)

     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;
 }