Patchwork [17/17] mmap_frag() users only check for -1 error

login
register
mail settings
Submitter Juan Quintela
Date Jan. 20, 2010, 8:14 p.m.
Message ID <783b5271b3a305f0fd9e4bf346f3c7f430311003.1264017981.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/43359/
State New
Headers show

Comments

Juan Quintela - Jan. 20, 2010, 8:14 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 linux-user/mmap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Laurent Desnogues - Jan. 25, 2010, 8:53 a.m.
On Wed, Jan 20, 2010 at 9:14 PM, Juan Quintela <quintela@redhat.com> wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  linux-user/mmap.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index c1c7e48..25fc0b2 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -243,7 +243,7 @@ static int mmap_frag(abi_ulong real_start,
>            possible while it is a shared mapping */
>         if ((flags & MAP_TYPE) == MAP_SHARED &&
>             (prot & PROT_WRITE))
> -            return -EINVAL;
> +            return -1;
>
>         /* adjust protection to be able to read */
>         if (!(prot1 & PROT_WRITE))

Looks good to me, but a similar patch is needed for
bsd-user/mmap.c and darwin-user/mmap.c.


Laurent

Patch

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index c1c7e48..25fc0b2 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -243,7 +243,7 @@  static int mmap_frag(abi_ulong real_start,
            possible while it is a shared mapping */
         if ((flags & MAP_TYPE) == MAP_SHARED &&
             (prot & PROT_WRITE))
-            return -EINVAL;
+            return -1;

         /* adjust protection to be able to read */
         if (!(prot1 & PROT_WRITE))