From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DPlCf-0007p1-C3 for qemu-devel@nongnu.org; Sun, 24 Apr 2005 13:47:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DPlCd-0007o2-Gw for qemu-devel@nongnu.org; Sun, 24 Apr 2005 13:47:32 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DPlCd-0007Fm-Ch for qemu-devel@nongnu.org; Sun, 24 Apr 2005 13:47:31 -0400 Received: from [65.74.133.9] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DPl8G-0002yE-Jm for qemu-devel@nongnu.org; Sun, 24 Apr 2005 13:43:00 -0400 From: Paul Brook Date: Sun, 24 Apr 2005 18:39:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504241839.35669.paul@codesourcery.com> Subject: [Qemu-devel] [patch] arm seek syscall fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 diff -u -p -r1.1 arm-semi.c --- linux-user/arm-semi.c 23 Apr 2005 18:25:40 -0000 1.1 +++ linux-user/arm-semi.c 24 Apr 2005 17:02:21 -0000 @@ -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;