summaryrefslogtreecommitdiffstats
path: root/otautil
diff options
context:
space:
mode:
Diffstat (limited to 'otautil')
-rw-r--r--otautil/SysUtil.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/otautil/SysUtil.cpp b/otautil/SysUtil.cpp
index 4cdd60d9f..efeb91c88 100644
--- a/otautil/SysUtil.cpp
+++ b/otautil/SysUtil.cpp
@@ -8,6 +8,7 @@
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -124,7 +125,7 @@ static int sysMapBlockFile(FILE* mapf, MemMapping* pMap)
break;
}
- void* addr = mmap64(next, length, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ((off64_t)start)*blksize);
+ void* addr = mmap64(next, length, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ((off64_t)(start*blksize)));
if (addr == MAP_FAILED) {
PLOG(ERROR) << "failed to map block " << i;
success = false;
@@ -141,10 +142,10 @@ static int sysMapBlockFile(FILE* mapf, MemMapping* pMap)
success = false;
}
if (!success) {
- close(fd);
- munmap(reserve, blocks * blksize);
- free(pMap->ranges);
- return -1;
+ close(fd);
+ munmap(reserve, blocks * blksize);
+ free(pMap->ranges);
+ return -1;
}
close(fd);