From 3b4f6950097f27841b7e4152088dfd2aad450cd3 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 7 Oct 2009 14:20:18 +0000 Subject: [PATCH] MAP_FAILED is more POSIX-ly correct than ((void*)-1). This commit was SVN r22063. --- opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c index 7c74064f8d..5527444760 100644 --- a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c @@ -134,7 +134,7 @@ static int ptmalloc2_open(void) } p = mmap(NULL, 4096, PROT_READ, (MAP_ANONYMOUS | MAP_PRIVATE), -1, 0); - if (((void*) -1) == p) { + if (MAP_FAILED == p) { return OPAL_ERR_OUT_OF_RESOURCE; } munmap(p, 4096);