diff --git a/linux-user/arm-semi.c b/linux-user/arm-semi.c index f37b65c471d64fbca464a79175e45ff384e03ff6..ea014f6bc7c699e57e97ed7fd9f7b5173bbcfeac 100644 --- a/linux-user/arm-semi.c +++ b/linux-user/arm-semi.c @@ -124,7 +124,10 @@ uint32_t do_arm_semihosting(CPUState *env) case SYS_ISTTY: return isatty(ARG(0)); case SYS_SEEK: - return set_swi_errno(ts, lseek(ARG(0), ARG(1), SEEK_SET)); + ret = set_swi_errno(ts, lseek(ARG(0), ARG(1), SEEK_SET)); + if (ret == (uint32_t)-1) + return -1; + return 0; case SYS_FLEN: { struct stat buf;