Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1467058img; Tue, 19 Mar 2019 08:14:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqztYU3bAXawQGrHNn5u4AaOduP/8tinN+xbtWsqJKleLWaD9mfT+hMdDC/nQqOeUeE6COeu X-Received: by 2002:a62:ee03:: with SMTP id e3mr2573222pfi.241.1553008483992; Tue, 19 Mar 2019 08:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553008483; cv=none; d=google.com; s=arc-20160816; b=SiOvBVRuEsKN+0qhi5HA0iLVcrzyGpTGVSz1WiWHxa/bdec4DHWlfaCK+WkJqmMRuw SOcnCsQYn6UNesQag3qbE1KqsLIogYOcpcya2KPreBxubxIy/eE3HOB6VYxjZ/WxkgcX QpF9wJp7Timq8Tn8Yoxjxylnkbow4svILJVgYYHEXyAkmxO290H7CC43WJc+D/jafq2t Z4/cxd0iDhY4Ftq7HcgoySBQCTKPlZ1nJ2sVsMfXOUhikziN1XzEH4Iq/fLb0J1rK/kt o3Ee1jL49L4qHRc3iOtaJe0fumRQ/oX2BLxqgLO18YpkIBqpAXjsSEIVONZA5kCx/Qu9 Otxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=AS3EvV7rlYAaswBBgvJO/ZK6uOlgHoPPO+mfzZyVHjA=; b=oyVOmjkiW7Im1MtFk7B+aSchbU7D92jyoWteKPqtHTcuuDEFh8iaxu1glvs8LW4sRz JqyM00ldGBXnh55vaj0iPAiaEcNCyWkirZj1AtyEvHg+0sDzUgafPn3gicI9e9fh8A4o wG/g2HVBrGyeuWqirzzmuDUI58smW58m45NXg6dnsH86eaVl7j5vSrZLFKHVuhrVKGdQ GKlS5HH7/a+2VxeLYv/b5FZND2yL9VQnk6FMNWCAJWGXJTsk5IvQ0qhTf7HuzICnTHw8 vu636KfmmVrDwfI2NHkTTSmII9gU8YYnQqZeVj3zStMICN5KiMRkKXaIcQsw9HAidv/5 rlJw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si11992509pfi.60.2019.03.19.08.14.27; Tue, 19 Mar 2019 08:14:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727472AbfCSPMj (ORCPT + 99 others); Tue, 19 Mar 2019 11:12:39 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35847 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbfCSPMi (ORCPT ); Tue, 19 Mar 2019 11:12:38 -0400 Received: by mail-ed1-f66.google.com with SMTP id e4so16935482edi.3; Tue, 19 Mar 2019 08:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AS3EvV7rlYAaswBBgvJO/ZK6uOlgHoPPO+mfzZyVHjA=; b=rRTInG0YQgxaYPUIHiRgPJcWQuyCzU6oAafO7wtqrE0MbNGwod5zcecQV3ZE6FhyUq 2bfy0e3gS92LM7CrycN0iMyV5IKrG6s0+3D+fELKbwjGc+HPV/EtA9cpPGYpM6mgNYjz MgxE8rufbE10GAiXFUHPvcehw1pm6HwUcOR7KIWflnHBO/KBAQ0shWSCvRBfD88ym039 E0gcTw8jTIsaY6wFMAhI4TugMmVcFKbrva/E0JGJZxb34R0/ipGf7XoodXcAeFNwb2iV GhbwLoUZjTIq0qujPzo+x/JswkCkqZKlcurAe56GSJnEUtgmsCvQgnKQR6YvFLPldvb3 RLoA== X-Gm-Message-State: APjAAAW38b1nnKh2lCpDTTsK0G96GCNA9I/x9q92D4iz1v2NI5Md81oZ s6KbWt/8jzV21KQ9fk7ApXSt+WMqa0pt+Xpjkxw= X-Received: by 2002:a17:906:7854:: with SMTP id p20mr14245685ejm.29.1553008356832; Tue, 19 Mar 2019 08:12:36 -0700 (PDT) MIME-Version: 1.0 References: <1549982079-23516-1-git-send-email-darcari@redhat.com> <1365e035-3218-aff5-6d86-05215ce25073@redhat.com> In-Reply-To: <1365e035-3218-aff5-6d86-05215ce25073@redhat.com> From: Len Brown Date: Tue, 19 Mar 2019 08:12:25 -0700 Message-ID: Subject: Re: [PATCH] tools/power turbostat: return the exit status of a command To: David Arcari Cc: Linux PM list , Len Brown , Jirka Hladky , linux-kernel@vger.kernel.org, Prarit Bhargava Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Len Brown On Wed, Feb 20, 2019 at 5:55 AM David Arcari wrote: > > > ping -- just want to make sure this doesn't get lost. > > Thanks! > > On 02/12/2019 09:34 AM, 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() > > > -- Len Brown, Intel Open Source Technology Center