aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-12-17 09:26:50 -0800
committerChirayu Desai <cdesai@cyanogenmod.org>2013-02-28 19:46:59 +0530
commitc3550dbf40f247519aa8bbd2eed1561d1b88e65f (patch)
tree9f897f2b6b79a58815a764573bd8a3ade8bbe3b4
parent7bbf5cba952b881474bc07a428ca7db7a23f7ea6 (diff)
downloadbootable_recovery-c3550dbf40f247519aa8bbd2eed1561d1b88e65f.zip
bootable_recovery-c3550dbf40f247519aa8bbd2eed1561d1b88e65f.tar.gz
bootable_recovery-c3550dbf40f247519aa8bbd2eed1561d1b88e65f.tar.bz2
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: Ic7e91285996f9f52d898326757c6fc53fcac34c9
-rw-r--r--minzip/SysUtil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/minzip/SysUtil.c b/minzip/SysUtil.c
index 49a2522..31c76d6 100644
--- a/minzip/SysUtil.c
+++ b/minzip/SysUtil.c
@@ -95,16 +95,16 @@ int sysLoadFileInShmem(int fd, MemMapping* pMap)
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;
}