diff options
author | Elliott Hughes <enh@google.com> | 2012-12-17 20:22:20 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-12-17 20:22:21 +0100 |
commit | 9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba (patch) | |
tree | 9795eb33d585e3096242ae09d6735668b488a3de /minzip/SysUtil.c | |
parent | am aa0dbb25: Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge (diff) | |
parent | Pass the correct pointer to munmap on failure. (diff) | |
download | android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar.gz android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar.bz2 android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar.lz android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar.xz android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.tar.zst android_bootable_recovery-9028fb4d4ceed040c7d3ae9b1ceaa5a7472856ba.zip |
Diffstat (limited to 'minzip/SysUtil.c')
-rw-r--r-- | minzip/SysUtil.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/minzip/SysUtil.c b/minzip/SysUtil.c index 49a2522d6..31c76d6d4 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; } |