summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-11-10 16:20:34 +0100
committerStefan Schmidt <stefan@osg.samsung.com>2015-11-10 16:20:34 +0100
commit0adc2138606c41cbbdde66c2548b024c1038493c (patch)
treed5b083d635662749f54f0ca024d033696dfff011
parentafe27002eeecdd15604d55896dd3b756f042b4aa (diff)
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
-rw-r--r--src/bin/raw/main.c2
1 files changed, 1 insertions, 1 deletions
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)
53 53
54 if (stat(file, &ss)) goto close_file; 54 if (stat(file, &ss)) goto close_file;
55 seg_size = ss.st_size; 55 seg_size = ss.st_size;
56 seg = mmap(0, seg_size, PROT_READ, MAP_SHARED, fd, 0); 56 seg = mmap(NULL, seg_size, PROT_READ, MAP_SHARED, fd, 0);
57 if (seg == MAP_FAILED) goto close_file; 57 if (seg == MAP_FAILED) goto close_file;
58 58
59 D("raw_init\n"); 59 D("raw_init\n");