Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp902534yba; Thu, 18 Apr 2019 11:30:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8uy9tuFjo80OwTgD7VwPKNT3SycHaMWFkSFLz/Iw7/CCSpWK7Kd/jz7Msd9McpPuSe4Ij X-Received: by 2002:a62:ac08:: with SMTP id v8mr96911117pfe.42.1555612219403; Thu, 18 Apr 2019 11:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555612219; cv=none; d=google.com; s=arc-20160816; b=n4fOasfGlfbYynQBE9uHsf3FM4F1JKIUF5/OGoA1bdVkqRMWDjzuUyU+ZrjZ5C6mtf n2b/sF7mVCSjjSe/zPt1aW0JQydu4pz5hSFXop47wC1kG88eGbeXUDk0Pbx6KNiyHP9l FgUNY10eZ80fL7aSZ+a9aglwc7mWWb7q0L1Fz4X48D3gX0pav5sw6XhmVwFQ5bokEgBT FtSzMYNWSnI5+olFukaplAJS/M8cwPuXm8fP8/u8dSn0ckDigOM83yBqQVIGWKbjt+zg Lr7XsSQeuPNpQEUkfNjhsjsuPLsc2iJ6HB0rjg2uhVpaMlReLCZSPw2P0NeqRV6xBw3X J6GQ== 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=lOgRy50+aH4tXV/AFCmS5FCtIOzgRK8/Ja7ornNnIQk=; b=w71v99U8brkRDrVpAgJ/Q2movqVTdAleRhvW5o3BzV33ZexWmMW7iRH0aXTc8nEuGI 7yvnE2yZknTFdTP77NaR7IAYkTJHPGFY9ghAxLY7EMrdQoJ0pLqLtO0B5rcyYwpOu+07 mmyAgGzz3CI9iX1EpQT85XRIRvkgKvUlidgCaKlzKkJyqIWCRfY1Q5ZyywhLbOoDJIwZ jaDKWdYyipU51vdLvFoA+932WJNfeX1CZtiCYYZQsMa9GZaSdG9ioPiaChrxIAVPo2uR Arn4UiKuhXNU6VvIo0HR/ZpUlp7uW8z9182mxfOONOLgAD0tMFS4sXIp1oev5kA7DMa6 H5pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LImz3IVa; 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 m3si2417035pgg.478.2019.04.18.11.30.04; Thu, 18 Apr 2019 11:30:19 -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=LImz3IVa; 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 S2390895AbfDRS2D (ORCPT + 99 others); Thu, 18 Apr 2019 14:28:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390967AbfDRSDg (ORCPT ); Thu, 18 Apr 2019 14:03:36 -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 A241B206B6; Thu, 18 Apr 2019 18:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610616; bh=7ihYAX00XcSV/L1eE0alfF9ExhwSeGSqJ2YE1Nb9EQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LImz3IVamFV7uQuv18hQwM+Imu4SSmHHtebHxPlhYimSnjip8yoYFO+QGewnoQ/5k xEdvmO8Fdgw7BWhIxsGZVLHrkzlVhraSDw0t8a8qH3I6AGXE6XnX/5JiLcpRDbfjaZ YtS8flT/SeoY4guCZXoyy4gY9QgOr4+o+zHCAFwM= 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.14 19/92] tools/power turbostat: return the exit status of a command Date: Thu, 18 Apr 2019 19:56:37 +0200 Message-Id: <20190418160431.992528077@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@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 7a1b20ec5216..d1b2348db0f9 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4588,6 +4588,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