From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXSpx-0008Em-CT for qemu-devel@nongnu.org; Tue, 08 Apr 2014 06:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXSpo-00028b-1g for qemu-devel@nongnu.org; Tue, 08 Apr 2014 06:01:01 -0400 Received: from mel.v6.act-europe.fr ([2a02:2ab8:224:1::a0a:d2]:54838 helo=smtp.eu.adacore.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXSpn-00027T-S0 for qemu-devel@nongnu.org; Tue, 08 Apr 2014 06:00:51 -0400 From: Eric Botcazou Date: Tue, 08 Apr 2014 12:00:04 +0200 Message-ID: <1615584.cDvrPMzPCT@polaris> In-Reply-To: References: <5047457.AHxDUeBxbN@polaris> <16061188.ySlPLF5O9B@polaris> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers > The reason we only exit with zero here is because the > semihosting API doesn't provide a way for the application > to report a non-zero exit code. In this case you're > distinguishing "application exit" from the other > failure reasons, which seems OK, though. I'm just > wary of patches trying to fix this issue because > in the past they've generally ignored the fact that > we're implementing a fixed API here and can't make > random additions to it just because they happen to work > with newlib or whatever. OK, I see. > Returning a negative exit code is bogus, though. You > probably just want > if (args == ADP_Stopped_ApplicationExit) { > code = EXIT_SUCCESS; > } else { > code = EXIT_FAILURE; > } The idea was to distinguish the supported arguments from the unknown ones (newlib only uses the listed two) but that would also work for me. -- Eric Botcazou