Received: from eggs.gnu.org ([208.118.235.92]:46806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT9aC-0006jv-Oo for qemu-devel@nongnu.org; Fri, 19 Apr 2013 07:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT9a8-0003QD-KR for qemu-devel@nongnu.org; Fri, 19 Apr 2013 07:34:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT9a8-0003Q1-CI for qemu-devel@nongnu.org; Fri, 19 Apr 2013 07:34:20 -0400 From: Stefan Hajnoczi Date: Fri, 19 Apr 2013 13:33:58 +0200 Message-Id: <1366371241-23430-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1366371241-23430-1-git-send-email-stefanha@redhat.com> References: <1366371241-23430-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 5/8] linux-user: change do_semop to return target errno when unsuccessful List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Petar Jovanovic , Stefan Hajnoczi From: Petar Jovanovic do_semop() is called from two places, and one of these fails to convert return error to target errno when semop fails. This patch changes the function to always return target errno in case of an unsuccessful call. Signed-off-by: Petar Jovanovic Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1f07621..d6d2050 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2764,7 +2764,7 @@ static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops) if (target_to_host_sembuf(sops, ptr, nsops)) return -TARGET_EFAULT; - return semop(semid, sops, nsops); + return get_errno(semop(semid, sops, nsops)); } struct target_msqid_ds @@ -6957,7 +6957,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_semop case TARGET_NR_semop: - ret = get_errno(do_semop(arg1, arg2, arg3)); + ret = do_semop(arg1, arg2, arg3); break; #endif #ifdef TARGET_NR_semctl -- 1.8.1.4