From patchwork Thu Jun 16 16:37:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 100670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 11A82B6F83 for ; Fri, 17 Jun 2011 03:15:11 +1000 (EST) Received: from localhost ([::1]:34796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXG9r-0002hs-GB for incoming@patchwork.ozlabs.org; Thu, 16 Jun 2011 13:15:07 -0400 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 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QXFZD-00029k-6A; Thu, 16 Jun 2011 17:37:15 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 16 Jun 2011 17:37:09 +0100 Message-Id: <1308242235-8261-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> References: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Riku Voipio , Juan Quintela , patches@linaro.org Subject: [Qemu-devel] [PATCH 2/8] syscall: really return ret code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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