Commit d0b3e73525f17fcffff7219c6bcc2b214cff7374

Authored by bellard
1 parent e9009676

SYS_SEEK fix (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1402 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 1 deletions
linux-user/arm-semi.c
@@ -124,7 +124,10 @@ uint32_t do_arm_semihosting(CPUState *env) @@ -124,7 +124,10 @@ uint32_t do_arm_semihosting(CPUState *env)
124 case SYS_ISTTY: 124 case SYS_ISTTY:
125 return isatty(ARG(0)); 125 return isatty(ARG(0));
126 case SYS_SEEK: 126 case SYS_SEEK:
127 - return set_swi_errno(ts, lseek(ARG(0), ARG(1), SEEK_SET)); 127 + ret = set_swi_errno(ts, lseek(ARG(0), ARG(1), SEEK_SET));
  128 + if (ret == (uint32_t)-1)
  129 + return -1;
  130 + return 0;
128 case SYS_FLEN: 131 case SYS_FLEN:
129 { 132 {
130 struct stat buf; 133 struct stat buf;