Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp151547img; Thu, 21 Mar 2019 16:29:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu3haUjcfnoIL60R9N8rLufKaW7XOV4LxLmUoHmWUtnZoZscWagBLQsXYcxpVVeg1rb0jB X-Received: by 2002:a63:4847:: with SMTP id x7mr5633486pgk.233.1553210959051; Thu, 21 Mar 2019 16:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553210959; cv=none; d=google.com; s=arc-20160816; b=ERlcfq+EL7vq+QJWHBG4OHxvmpoNkMeAqSTehVhGkqYGAa+WwqYpecs0Po4apvwBoC NjxrrW0YyAe2Fc5M3sWL4PW9EKyjXjJWdQsTS1MTHUDK3oCu5uxEdK3YUZ/1j/2JD3Cq Pybz/yS3GlnU/leO2fSMJ2De8tn6KFgnHdv8d7TZGlwS4Jp/f8sYW+QlWeBVyP55cZjd 7dIEjlMyqiqSNTjrQrVzaYUJYvy+7N0yJMowN/Ws+0DxgKER4FEoZn56iD8qaNqe5ATn +ifh1W2luoIpLAhtMatDESBrvw0N28Zcx9QHLUNum3o3Pr2VwK1Xe7yqCmdbOyRuYKuI 1eDQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZbqV2udJlEqSh9qqXSabm6dDURHO2kO3O+plspxpVbA=; b=RrFCFishNWCc+5Ayk/BazPB1r735/zZdB1gabJa1LsJWU5HRWcLZgWCgeiF1F9tp7H sDwFlN1x+CBXL9wvE4ROtENc3+LNji3NP0VbIG/7vVLuCplgdEImcp9MecSc/fYjdUyA HXuypDcuASAr/2TcL9s5k0AhJTztX6MKi6P3L/mI0bh/3wW3xg3/U9PHdKLAGkZsPPEI ZqFtJD9rV+q/JkTo+8pBb6Mrw5pLAy51QrZ6QALup2IvE6g7pNLSJjI44Bg8xvtU8GiT yL0AwJfRSRgpWeDpC0Pm6mlLLQBkGMp0g0bVJKglUhqLsQJ7k35dqRdcvZZEHiD8o8h+ FPzg== ARC-Authentication-Results: i=1; mx.google.com; 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 d126si5149150pgc.597.2019.03.21.16.29.00; Thu, 21 Mar 2019 16:29: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; 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 S1727162AbfCUX2O (ORCPT + 99 others); Thu, 21 Mar 2019 19:28:14 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42436 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbfCUX2O (ORCPT ); Thu, 21 Mar 2019 19:28:14 -0400 Received: from 79.184.255.210.ipv4.supernova.orange.pl (79.184.255.210) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.213) id 79154635c086280c; Fri, 22 Mar 2019 00:28:12 +0100 From: "Rafael J. Wysocki" To: David Arcari Cc: linux-pm@vger.kernel.org, Len Brown , Jirka Hladky , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools/power turbostat: return the exit status of a command Date: Fri, 22 Mar 2019 00:26:18 +0100 Message-ID: <1920733.IGH1RQtUIy@aspire.rjw.lan> In-Reply-To: <1549982079-23516-1-git-send-email-darcari@redhat.com> References: <1549982079-23516-1-git-send-email-darcari@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, February 12, 2019 3:34:39 PM CET David Arcari wrote: > 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 > Cc: Len Brown > Cc: Jirka Hladky > Cc: linux-kernel@vger.kernel.org > --- > 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 9327c0d..c3fad06 100644 > --- a/tools/power/x86/turbostat/turbostat.c > +++ b/tools/power/x86/turbostat/turbostat.c > @@ -5077,6 +5077,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() > Applied, thanks!