From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXFst-0007ci-Az for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXFrq-0000in-EI for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:57:34 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:57917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXFrp-0000hX-MV for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:56:30 -0400 From: Peter Maydell Date: Thu, 16 Jun 2011 17:37:09 +0100 Message-Id: <1308242235-8261-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> References: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 2/8] syscall: really return ret code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , Juan Quintela , patches@linaro.org From: Juan Quintela We assign ret with the error code, but then return 0 unconditionally. Signed-off-by: Juan Quintela Signed-off-by: Peter Maydell --- linux-user/syscall.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5cb27c7..f3d03b0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3751,10 +3751,10 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) #ifndef TARGET_ABI32 static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) { - abi_long ret; + abi_long ret = 0; abi_ulong val; int idx; - + switch(code) { case TARGET_ARCH_SET_GS: case TARGET_ARCH_SET_FS: @@ -3773,13 +3773,13 @@ static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) idx = R_FS; val = env->segs[idx].base; if (put_user(val, addr, abi_ulong)) - return -TARGET_EFAULT; + ret = -TARGET_EFAULT; break; default: ret = -TARGET_EINVAL; break; } - return 0; + return ret; } #endif -- 1.7.1