From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTBrC-0007Sz-Lt for qemu-devel@nongnu.org; Fri, 19 Apr 2013 10:00:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UTBr7-00034g-3L for qemu-devel@nongnu.org; Fri, 19 Apr 2013 10:00:06 -0400 Received: from afflict.kos.to ([92.243.29.197]:51618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTBr6-00033w-Ri for qemu-devel@nongnu.org; Fri, 19 Apr 2013 10:00:00 -0400 Received: from kos.to (a91-156-57-234.elisa-laajakaista.fi [91.156.57.234]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id E3DD82654C for ; Fri, 19 Apr 2013 15:59:58 +0200 (CEST) From: riku.voipio@linaro.org Date: Fri, 19 Apr 2013 16:59:54 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 1/3] 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: Petar Jovanovic 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: Riku Voipio --- 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.7.10.4