Message ID | 1262403933-26881-15-git-send-email-kirill@shutemov.name |
---|---|
State | New |
Headers | show |
diff --git a/linux-user/mmap.c b/linux-user/mmap.c index c1c7e48..47bc339 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -242,8 +242,10 @@ static int mmap_frag(abi_ulong real_start, /* msync() won't work here, so we return an error if write is possible while it is a shared mapping */ if ((flags & MAP_TYPE) == MAP_SHARED && - (prot & PROT_WRITE)) - return -EINVAL; + (prot & PROT_WRITE)) { + errno = -EINVAL; + return -1; + } /* adjust protection to be able to read */ if (!(prot1 & PROT_WRITE))
mmap_frag() returns -1 on error and set errno. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> --- linux-user/mmap.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)