From patchwork Thu Jun 2 11:53:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 98375 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 CA002B6F97 for ; Thu, 2 Jun 2011 22:09:48 +1000 (EST) Received: from localhost ([::1]:59828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS6if-0000Oq-BP for incoming@patchwork.ozlabs.org; Thu, 02 Jun 2011 08:09:45 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS6UC-0005nJ-Jk for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS6UA-0005kl-U7 for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS6UA-0005kQ-Cc for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:46 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p52Bsj8C020835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jun 2011 07:54:45 -0400 Received: from neno.mitica (vpn1-5-74.ams2.redhat.com [10.36.5.74]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p52BsYdQ015781; Thu, 2 Jun 2011 07:54:44 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 2 Jun 2011 13:53:43 +0200 Message-Id: <5daccf2bf241e937136c5651e3392f181aa4c850.1307014902.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 08/14] 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 We assign ret with the error code, but then return 0 unconditionally. Signed-off-by: Juan Quintela Reviewed-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