From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IgM7y-0002A8-ET for qemu-devel@nongnu.org; Fri, 12 Oct 2007 11:08:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IgM7w-00028l-1S for qemu-devel@nongnu.org; Fri, 12 Oct 2007 11:08:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgM7v-00028i-R6 for qemu-devel@nongnu.org; Fri, 12 Oct 2007 11:08:35 -0400 Received: from owa.c2.net ([207.235.78.2] helo=email.c2.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IgM7v-0004Zh-Od for qemu-devel@nongnu.org; Fri, 12 Oct 2007 11:08:35 -0400 Subject: Re: [Qemu-devel] [PATCH] syscall_target_errno.patch From: Thayne Harbaugh In-Reply-To: <1192073888.8097.14.camel@phantasm.home.enterpriseandprosperity.com> References: <1192073888.8097.14.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: text/plain Date: Fri, 12 Oct 2007 09:00:54 -0600 Message-Id: <1192201254.5280.3.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: thayne@c2.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, 2007-10-10 at 21:38 -0600, Thayne Harbaugh wrote: > I have noticed that many functions in syscall.c return a *host* errno > when a *target* errno should be return. At the same time, there are > several places in syscall.c:do_syscall() that immediately return an > errno rather than setting the return value and exiting through the > syscall return value reporting at the end of do_syscall(). > > This patch addresses both of those problems at once rather than touching > the exact same errno return lines twice in do_syscall(). The patch is better with parenthesis around the arguments of the return_err() macro: #define return_err(err) do { ret = -(err); goto fail; } while(0)