From patchwork Fri Oct 2 13:01:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 54439 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 77C2723009 for ; Fri, 2 Oct 2015 13:52:32 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf8294504wic.3 for ; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=W6Wss5C4sSaV8x2i8z3zJs0gFuo5ppoShre9bVgCc34=; b=df7KALDzlCG7DqgGG5WwrQ6aKntC7qUu7WsMYP/fe+Gy7+74GOGGeYNiqRgxGJ1HiW NzDu0rbQbZ4ENwaF8JT1PtXop8kdbz+Kj9sYZhS1YNFrb6c6zpB6ekgIVlNeJ9aDD/QQ 7CeSxUzh5fDrWM1+c7Xwmyy9sWAOcffJLSAPD/2yzRzip/MCuHJSuAoLKijOW5uGZmyw W2k7WdLUhzAh/cBkpPbgoCOqbR000/puQhg1nlxNJlXSX6rZITlZ7QIcjgz3FCWBJd7V 8Gvr2AUdmaV+KCmh38n9WjQl54SZ9mB+iDmKYaI3M/vav2lsH23POGX6nKyCS3PlpNZ/ T2bg== X-Gm-Message-State: ALoCoQkGNKgNbae7vsD0mRLJWK+BxQQ3oh5aI9aAID0zvs/hgEaz5EY2sY+7D8SPBWmvhihZU4jb X-Received: by 10.181.29.103 with SMTP id jv7mr986187wid.0.1443793951809; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.89.207 with SMTP id n198ls226798lfb.54.gmail; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) X-Received: by 10.112.198.198 with SMTP id je6mr5805473lbc.31.1443793951649; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id tb2si6287646lbb.176.2015.10.02.06.52.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 06:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbwr8 with SMTP id r8so26751373lbw.2 for ; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) X-Received: by 10.25.40.130 with SMTP id o124mr3638968lfo.41.1443793951511; Fri, 02 Oct 2015 06:52:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1259181lbq; Fri, 2 Oct 2015 06:52:30 -0700 (PDT) X-Received: by 10.55.197.146 with SMTP id k18mr20115509qkl.96.1443793950158; Fri, 02 Oct 2015 06:52:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f47si10362051qge.78.2015.10.02.06.52.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 02 Oct 2015 06:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi0lB-0005s9-Qk for patch@linaro.org; Fri, 02 Oct 2015 09:52:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzxl-0005S5-Rs for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zhzxf-0000eK-VQ for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:25 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:33785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzxf-0000e7-PA for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:19 -0400 Received: by lbos8 with SMTP id s8so25981972lbo.0 for ; Fri, 02 Oct 2015 06:01:19 -0700 (PDT) X-Received: by 10.25.165.4 with SMTP id o4mr3556627lfe.4.1443790879067; Fri, 02 Oct 2015 06:01:19 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id w143sm1514751lfd.2.2015.10.02.06.01.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Oct 2015 06:01:18 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 2 Oct 2015 16:01:01 +0300 Message-Id: <93b4eff80af9822e4b726dcf21ee61538e088695.1443790691.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.175 Cc: Timothy E Baldwin Subject: [Qemu-devel] [PULL 09/13] linux-user: Return target error number in do_fork() 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Timothy E Baldwin Whilst calls to do_fork() are wrapped in get_errno() this does not translate return values. Reviewed-by: Peter Maydell Signed-off-by: Timothy Edward Baldwin Signed-off-by: Riku Voipio --- linux-user/syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 75ac32c..c25ffd8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4626,8 +4626,9 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, pthread_mutex_unlock(&clone_lock); } else { /* if no CLONE_VM, we consider it is a fork */ - if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) - return -EINVAL; + if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) { + return -TARGET_EINVAL; + } fork_start(); ret = fork(); if (ret == 0) {