summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-22 16:27:19 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-22 16:27:19 +0000
commit49ea55f5993773391db32e04c5dc94ca91a68c5e (patch)
tree4fb76a8025263fa51a65ab30fc7aef6c30c5ff26
parent72f51179849c338747fd83d638c90b6be42a43cf (diff)
parent48ac3d1b14f036a4994adba22707f7465ccfae2f (diff)
downloadsystem_core-49ea55f5993773391db32e04c5dc94ca91a68c5e.zip
system_core-49ea55f5993773391db32e04c5dc94ca91a68c5e.tar.gz
system_core-49ea55f5993773391db32e04c5dc94ca91a68c5e.tar.bz2
am 48ac3d1b: Merge "Judge mmap failed by MAP_FAILED instead of NULL"
* commit '48ac3d1b14f036a4994adba22707f7465ccfae2f': Judge mmap failed by MAP_FAILED instead of NULL
-rw-r--r--fastbootd/transport.c2
-rw-r--r--libpixelflinger/codeflinger/CodeCache.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/fastbootd/transport.c b/fastbootd/transport.c
index ce8f9d0..9a16fd7 100644
--- a/fastbootd/transport.c
+++ b/fastbootd/transport.c
@@ -55,7 +55,7 @@ int transport_handle_download(struct transport_handle *thandle, size_t len)
ftruncate(fd, len);
buffer = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (buffer == NULL) {
+ if (buffer == MAP_FAILED) {
D(ERR, "mmap(%zu) failed: %d %s", len, errno, strerror(errno));
goto err;
}
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp
index 7446da2..8afe0a9 100644
--- a/libpixelflinger/codeflinger/CodeCache.cpp
+++ b/libpixelflinger/codeflinger/CodeCache.cpp
@@ -89,7 +89,7 @@ static mspace getMspace()
gExecutableStore = mmap(NULL, kMaxCodeCacheCapacity,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE, fd, 0);
- LOG_ALWAYS_FATAL_IF(gExecutableStore == NULL,
+ LOG_ALWAYS_FATAL_IF(gExecutableStore == MAP_FAILED,
"Creating code cache, mmap failed with error "
"'%s'", strerror(errno));
close(fd);