Skip to contentSkip to conversation

arm seek syscall fix

PATCH New Paul Brook 1 participant 1 message Apr 24, 2005

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 arm seek syscall fix

The patch below corrects the arm semihosting seek syscall return value.

Paul

Index: linux-user/arm-semi.c
===================================================================
RCS file: /cvsroot/qemu/qemu/linux-user/arm-semi.c,v retrieving revision 1.1

arm-semi.c +4 -1
diff -u -p -r1.1 arm-semi.c
@@ -124,7 +125,10 @@ uint32_t do_arm_semihosting(CPUState *en
     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;