Commit b79b158d authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

ntdll: Always use MAP_FAILED as mmap()'s error value.

parent 141fdcc0
...@@ -1807,7 +1807,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start ...@@ -1807,7 +1807,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start
/* only try mmap if media is not removable (or if we require write access) */ /* only try mmap if media is not removable (or if we require write access) */
if (!removable || (flags & MAP_SHARED)) if (!removable || (flags & MAP_SHARED))
{ {
if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1) if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != MAP_FAILED)
goto done; goto done;
switch (errno) switch (errno)
...@@ -1970,7 +1970,7 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable ) ...@@ -1970,7 +1970,7 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable )
if (!*removable) if (!*removable)
{ {
if (mmap( ptr, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_FIXED|MAP_PRIVATE, fd, 0 ) != (void *)-1) if (mmap( ptr, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_FIXED|MAP_PRIVATE, fd, 0 ) != MAP_FAILED)
return STATUS_SUCCESS; return STATUS_SUCCESS;
switch (errno) switch (errno)
......
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