From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGYWz-0000od-0y for qemu-devel@nongnu.org; Tue, 16 Jun 2009 09:16:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGYWu-0000mZ-90 for qemu-devel@nongnu.org; Tue, 16 Jun 2009 09:16:52 -0400 Received: from [199.232.76.173] (port=54531 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGYWu-0000mO-2U for qemu-devel@nongnu.org; Tue, 16 Jun 2009 09:16:48 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42250) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGYWt-0001fs-MG for qemu-devel@nongnu.org; Tue, 16 Jun 2009 09:16:47 -0400 Message-ID: <4A379B41.7040701@redhat.com> Date: Tue, 16 Jun 2009 16:16:49 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] raw-posix: Remove O_RDWR when attempting to open a file read-only References: <1245154972-21581-1-git-send-email-avi@redhat.com> <1245154972-21581-3-git-send-email-avi@redhat.com> <4A379A37.3020903@redhat.com> In-Reply-To: <4A379A37.3020903@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Christoph Hellwig On 06/16/2009 04:12 PM, Kevin Wolf wrote: >> + s->open_flags&= ~O_RDWR; >> s->open_flags |= O_RDONLY; >> bs->read_only = 1; >> } >> > > Does the standard say anything about the values of the constants? > Wouldn't it be cleaner to have a s->open_flags&= ~O_ACCMODE before the > if instead, so that O_RDONLY is reset in the other case? > Didn't know about O_ACCMODE. Will fix and repost. -- error compiling committee.c: too many arguments to function