From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZKh5-00052J-V0 for qemu-devel@nongnu.org; Mon, 25 Jan 2010 03:53:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZKh1-0004zQ-Fb for qemu-devel@nongnu.org; Mon, 25 Jan 2010 03:53:11 -0500 Received: from [199.232.76.173] (port=33796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZKh1-0004zN-9U for qemu-devel@nongnu.org; Mon, 25 Jan 2010 03:53:07 -0500 Received: from mx20.gnu.org ([199.232.41.8]:48225) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZKh0-000092-O5 for qemu-devel@nongnu.org; Mon, 25 Jan 2010 03:53:06 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZKgz-0003YX-IW for qemu-devel@nongnu.org; Mon, 25 Jan 2010 03:53:05 -0500 Received: by pwj11 with SMTP id 11so2339126pwj.2 for ; Mon, 25 Jan 2010 00:53:03 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <783b5271b3a305f0fd9e4bf346f3c7f430311003.1264017981.git.quintela@redhat.com> References: <783b5271b3a305f0fd9e4bf346f3c7f430311003.1264017981.git.quintela@redhat.com> Date: Mon, 25 Jan 2010 09:53:03 +0100 Message-ID: <761ea48b1001250053y39d62dc7t59bcdeddeff90277@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH 17/17] mmap_frag() users only check for -1 error From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Wed, Jan 20, 2010 at 9:14 PM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > =A0linux-user/mmap.c | =A0 =A02 +- > =A01 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, > =A0 =A0 =A0 =A0 =A0 =A0possible while it is a shared mapping */ > =A0 =A0 =A0 =A0 if ((flags & MAP_TYPE) =3D=3D MAP_SHARED && > =A0 =A0 =A0 =A0 =A0 =A0 (prot & PROT_WRITE)) > - =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; > + =A0 =A0 =A0 =A0 =A0 =A0return -1; > > =A0 =A0 =A0 =A0 /* adjust protection to be able to read */ > =A0 =A0 =A0 =A0 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