From c86f22c131ef72bd3350720d2029766c4f0721f3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 17 Dec 2012 09:26:50 -0800 Subject: 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 --- minzip/SysUtil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'minzip') 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; } -- cgit v1.1