mirror of https://gitee.com/openkylin/qemu.git
mmap(2) returns MAP_FAILED, not NULL, on failure
Signed-off-by: Michael McConville <mmcco@mykolab.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
9aae6e549d
commit
ab1ce9bd48
|
@ -199,7 +199,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
|
||||||
*/
|
*/
|
||||||
vaddr_base = mmap(vaddr, size, PROT_READ | PROT_WRITE,
|
vaddr_base = mmap(vaddr, size, PROT_READ | PROT_WRITE,
|
||||||
MAP_ANON | MAP_SHARED, -1, 0);
|
MAP_ANON | MAP_SHARED, -1, 0);
|
||||||
if (vaddr_base == NULL) {
|
if (vaddr_base == MAP_FAILED) {
|
||||||
perror("mmap");
|
perror("mmap");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue