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:
Michael McConville 2017-12-01 11:31:57 -07:00 committed by Michael Tokarev
parent 9aae6e549d
commit ab1ce9bd48

View File

@ -199,7 +199,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
*/
vaddr_base = mmap(vaddr, size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0);
if (vaddr_base == NULL) {
if (vaddr_base == MAP_FAILED) {
perror("mmap");
exit(-1);
}