aboutsummaryrefslogtreecommitdiffstats
path: root/minzip
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-12-17 12:11:47 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-17 12:11:47 -0800
commit9da1880118c58e45543d9f3b2356e9f833582c9a (patch)
tree0496e3ff94041561e9235f6be08235195cbd836e /minzip
parent1fca2650edb5ae373a297b6029df5e250c021dd3 (diff)
parent9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba (diff)
downloadbootable_recovery-9da1880118c58e45543d9f3b2356e9f833582c9a.zip
bootable_recovery-9da1880118c58e45543d9f3b2356e9f833582c9a.tar.gz
bootable_recovery-9da1880118c58e45543d9f3b2356e9f833582c9a.tar.bz2
am 9028fb4d: Merge "Pass the correct pointer to munmap on failure."
* commit '9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba': Pass the correct pointer to munmap on failure.
Diffstat (limited to 'minzip')
-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;
}