qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status
Date: Tue, 08 Apr 2014 12:00:04 +0200	[thread overview]
Message-ID: <1615584.cDvrPMzPCT@polaris> (raw)
In-Reply-To: <CAFEAcA-kthmFCgcM5U5z97Wxi4NJx7XMePWcqPD9_eWF6b0swg@mail.gmail.com>

> 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

      reply	other threads:[~2014-04-08 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 21:42 [Qemu-devel] [PATCH] target-arm: return more meaningful exit status Eric Botcazou
2014-04-08  7:53 ` Peter Maydell
2014-04-08  8:34   ` Eric Botcazou
2014-04-08  9:38     ` Peter Maydell
2014-04-08 10:00       ` Eric Botcazou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1615584.cDvrPMzPCT@polaris \
    --to=ebotcazou@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).