From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIjmF-0006k8-9z for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIjmD-0007cE-UO for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:59:47 -0400 Received: from mail.rt-rk.ftn.uns.ac.rs ([147.91.177.140]:45202 helo=mail.rt-rk.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIjmD-0007bq-Ni for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:59:45 -0400 Received: from mail.rt-rk.com (mail.localdomain [127.0.0.1]) by mail.rt-rk.com (Postfix) with SMTP id BAB7725BC0C for ; Thu, 21 Mar 2013 18:59:41 +0100 (CET) From: Petar Jovanovic Date: Thu, 21 Mar 2013 18:57:36 +0100 Message-Id: <1363888656-123910-1-git-send-email-petar.jovanovic@rt-rk.com> Subject: [Qemu-devel] [PATCH] 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: riku.voipio@linaro.org, petar.jovanovic@imgtec.com 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 --- 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 ee82a2d..3c4c155 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.7.9.5