Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp896969yba; Thu, 18 Apr 2019 11:23:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqjbYvWHWxK5g4lw9FaOZmWZxrvQWNwLeF6yqMi5F2h4EtfdX+O9EXDNMeuaL1EP5oj7nq X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr17647180pls.40.1555611839346; Thu, 18 Apr 2019 11:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611839; cv=none; d=google.com; s=arc-20160816; b=bhMmp3gep1NAVjCGyKNrrBl2wMZ4277e99Q4VW1QH/Lzm6eJHEZtqNpngapSF8sYxJ XQlCL2oHgwd929xgAeUkp3iD/JPC9zTonOEPSNnQRYE3huFHXFpzKRY5CBREjDaitsRh Kn+PzXXV3YWiZn2dIcucaPny2vLcvK87EfwxWkWvpgBGfhSpFxQoH2GgaYLI0Oof33X9 jYhOMX5plXEtYIdLlVqH2AE/YIJhclwjvZ1anKf9KZ7vWSD85lJdddc67HJ86Q1636jf OIxwR7ybrB7ISZ5jSVXkeXdL20qD19/NajiX9lX1qPXKRG72S+NgN6OawZEpF9MaCId7 xDTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SypLJlmS+00Cg5FUU3+kA1h1LcKSyMHpcp4Qq1HO9Q8=; b=ckNeHV9zf+5jsjTaFD+MoAhwNthHmCd/tHRpXzWitGHOXj1YQkEn8Sm1Zet54nQf+r ZvyGd4cEQGC6Gkfyw31DAem+lznco23KVNJ4SU4QyE5syoajoh28uv8AzSKM0c1I9POS 9colEpB17sgSl3fqnyXFaa2rMi5L2KQTOCMC9oYjaI7KcVUvYJjZ+bNJScYGWIqhQxaj pdnBalqYI+xJ0kpV32OUna3UCVXoYJVEBFcu9CmhNvDWp0b+MINDLR440LLZf7sFQXuC efVa5xByP//0kFoog+nIszN4Thuuy85445jRFfKsddD3sYloJP2yrMZ6yWyIYJ7JDag3 7tSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kLPswaht; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y62si2491186pgd.142.2019.04.18.11.23.44; Thu, 18 Apr 2019 11:23:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kLPswaht; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404020AbfDRSWK (ORCPT + 99 others); Thu, 18 Apr 2019 14:22:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:37590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391622AbfDRSHW (ORCPT ); Thu, 18 Apr 2019 14:07:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74F992186A; Thu, 18 Apr 2019 18:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610841; bh=3C36l92cNG6sEqy6ZrrElWb6yU8msoO9Dr083m4+WJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLPswaht+TG3Gl4VaOX060+1EfCNWutax3r5baxqIgPbCTL8/Zfi4cCToS/0QUX5v GkWK/oqYJ4/dK52AbDyzt1jNPNHI/S3zCUMTY3RZkdQx48rWDs5i2PLtXfd1jXTB2D QeCJiKzxrQm9HIBkbOuq+1warDJoGTwULGBU0ZIk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Arcari , Len Brown , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.9 12/50] tools/power turbostat: return the exit status of a command Date: Thu, 18 Apr 2019 19:57:23 +0200 Message-Id: <20190418160424.278403172@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160422.455656724@linuxfoundation.org> References: <20190418160422.455656724@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2a95496634a017c19641f26f00907af75b962f01 ] turbostat failed to return a non-zero exit status even though the supplied command (turbostat ) failed. Currently when turbostat forks a command it returns zero instead of the actual exit status of the command. Modify the code to return the exit status. Signed-off-by: David Arcari Acked-by: Len Brown Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- tools/power/x86/turbostat/turbostat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 5ec2de8f49b4..b4c5d96e54c1 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -3691,6 +3691,9 @@ int fork_it(char **argv) signal(SIGQUIT, SIG_IGN); if (waitpid(child_pid, &status, 0) == -1) err(status, "waitpid"); + + if (WIFEXITED(status)) + status = WEXITSTATUS(status); } /* * n.b. fork_it() does not check for errors from for_all_cpus() -- 2.19.1