From 00dff3bddc375e88e710a751f47843f9da77a70c Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Mon, 13 Apr 2009 14:02:57 +0530 Subject: use MAP_FAILED macro to check for mmap failure instead of (void *) -1 Signed-off-by: Anand V. Avati --- libglusterfs/src/iobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs/src/iobuf.c') diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index 2a97d9995..b54f31243 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -118,7 +118,7 @@ __iobuf_arena_alloc (struct iobuf_pool *iobuf_pool) arena_size = iobuf_pool->arena_size; iobuf_arena->mem_base = mmap (NULL, arena_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - if (iobuf_arena->mem_base == ((void *) -1)) + if (iobuf_arena->mem_base == MAP_FAILED) goto err; __iobuf_arena_init_iobufs (iobuf_arena); -- cgit