Commit 6077eb5c authored by Jeff Dike's avatar Jeff Dike

Correctly check the mmap return value.

parent 9ebf50f0
......@@ -26,7 +26,7 @@ void remap_data(void *segment_start, void *segment_end, int w)
(unsigned long) segment_start;
data = create_mem_file(size);
if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ,
MAP_SHARED, data, 0)) < 0){
MAP_SHARED, data, 0)) == MAP_FAILED){
perror("mapping new data segment");
exit(1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment