libxl_internal.c: Fix return handling for case of mmap failure

mmap() returns MAP_FAILED not NULL.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Don Slutz authored and Ian Campbell committed 2014-07-30 12:42:17 +01:00
1 parent 822b956ef7
commit 8a14ca08f2
1 file changed
+1 -1
+1 -1
View File
@@ -246,7 +246,7 @@ int libxl__file_reference_map(libxl__file_reference *f)
ret = -1;
data = mmap(NULL, st_buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (data == NULL)
if (data == MAP_FAILED)
goto out;
f->mapped = 1;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.