[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status
From: |
Eric Botcazou |
Subject: |
Re: [Qemu-devel] [PATCH] target-arm: return more meaningful exit status |
Date: |
Tue, 08 Apr 2014 12:00:04 +0200 |
User-agent: |
KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) |
> 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