From patchwork Mon Jun 20 16:20:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 101159 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 30F66B6F7D for ; Tue, 21 Jun 2011 02:59:01 +1000 (EST) Received: from localhost ([::1]:41893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYhoP-0004ZQ-Nb for incoming@patchwork.ozlabs.org; Mon, 20 Jun 2011 12:58:58 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYhDc-0003YZ-FP for qemu-devel@nongnu.org; Mon, 20 Jun 2011 12:20:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYhDa-0008Ox-CG for qemu-devel@nongnu.org; Mon, 20 Jun 2011 12:20:56 -0400 Received: from afflict.kos.to ([92.243.29.197]:34632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYhDZ-0008Op-Uh for qemu-devel@nongnu.org; Mon, 20 Jun 2011 12:20:54 -0400 Received: from kos.to (a88-115-163-181.elisa-laajakaista.fi [88.115.163.181]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 3A2442668F; Mon, 20 Jun 2011 16:20:52 +0000 (UTC) Received: by kos.to (sSMTP sendmail emulation); Mon, 20 Jun 2011 19:20:51 +0300 From: riku.voipio@iki.fi To: qemu-devel@nongnu.org Date: Mon, 20 Jun 2011 19:20:16 +0300 Message-Id: <469e6f24b804ea2031d14c84b11ef6f611cd2f8b.1308583801.git.riku.voipio@iki.fi> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 92.243.29.197 Cc: Juan Quintela Subject: [Qemu-devel] [PATCH 11/18] 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 Signed-off-by: Riku Voipio --- 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 362cc63..57d9233 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3779,10 +3779,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: @@ -3801,13 +3801,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