qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status
Date: Tue, 8 Apr 2014 10:38:59 +0100

On 8 April 2014 09:34, Eric Botcazou <address@hidden> wrote:
>> Since you've found that, can you provide your answer to the objection
>> raised back then, that this is not permitted by the semihosting API
>> which we are implementing here?
>
> I don't understand the question: what is not permitted exactly?

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.

Returning a negative exit code is bogus, though. You
probably just want
   if (args == ADP_Stopped_ApplicationExit) {
       code = EXIT_SUCCESS;
   } else {
       code = EXIT_FAILURE;
   }

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]