mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
semihosting: Adjust error checking in common_semi_cb
The err parameter is non-zero if and only if an error occured. Use this instead of ret == -1 for determining if we need to update the saved errno. This fixes the errno setting of SYS_ISTTY, which returns 0 on error, not -1. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
5aadd18299
commit
709fe27b18
1 changed files with 1 additions and 1 deletions
|
@ -290,7 +290,7 @@ static target_ulong common_semi_syscall_len;
|
||||||
|
|
||||||
static void common_semi_cb(CPUState *cs, target_ulong ret, target_ulong err)
|
static void common_semi_cb(CPUState *cs, target_ulong ret, target_ulong err)
|
||||||
{
|
{
|
||||||
if (ret == (target_ulong)-1) {
|
if (err) {
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
TaskState *ts = cs->opaque;
|
TaskState *ts = cs->opaque;
|
||||||
ts->swi_errno = err;
|
ts->swi_errno = err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue