Skip to content
Snippets Groups Projects
Commit 709fe27b authored by Richard Henderson's avatar Richard Henderson
Browse files

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: default avatarAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 5aadd182
No related branches found
No related tags found
No related merge requests found
......@@ -290,7 +290,7 @@ static target_ulong common_semi_syscall_len;
static void common_semi_cb(CPUState *cs, target_ulong ret, target_ulong err)
{
if (ret == (target_ulong)-1) {
if (err) {
#ifdef CONFIG_USER_ONLY
TaskState *ts = cs->opaque;
ts->swi_errno = err;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment