From 0adc2138606c41cbbdde66c2548b024c1038493c Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 10 Nov 2015 16:20:34 +0100 Subject: raw: pass NULL to mmap() instead 0 for address Surprising to see this. mmap() expects a void * as address here. If we want to let the kernel choose the address we should really pass in NULL instead of the integer 0 --- src/bin/raw/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/raw/main.c b/src/bin/raw/main.c index bceb9ff..ac9f810 100644 --- a/src/bin/raw/main.c +++ b/src/bin/raw/main.c @@ -53,7 +53,7 @@ _raw_init(const char *file) if (stat(file, &ss)) goto close_file; seg_size = ss.st_size; - seg = mmap(0, seg_size, PROT_READ, MAP_SHARED, fd, 0); + seg = mmap(NULL, seg_size, PROT_READ, MAP_SHARED, fd, 0); if (seg == MAP_FAILED) goto close_file; D("raw_init\n"); -- cgit v1.2.1