qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 15/15] linux-user: fix return value of mmap_frag()


From: Kirill A. Shutemov
Subject: [Qemu-devel] [PATCH 15/15] linux-user: fix return value of mmap_frag()
Date: Sat, 2 Jan 2010 05:45:33 +0200

mmap_frag() returns -1 on error and set errno.

Signed-off-by: Kirill A. Shutemov <address@hidden>
---
 linux-user/mmap.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

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))
-- 
1.6.5.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]