Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3919477imj; Tue, 12 Feb 2019 06:56:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IbaA4idIzjTFUNst3UrXl+zcorerB0NTvc23fF0sYToJ7Wty+imH0NhCNx7RAYgqV6DXpPl X-Received: by 2002:a63:f648:: with SMTP id u8mr447249pgj.91.1549983413181; Tue, 12 Feb 2019 06:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549983413; cv=none; d=google.com; s=arc-20160816; b=dk03HBVwyjuonjFNr+PVGEOWKORdKhkn7QalcbdUxR/UvWY4OIupkvnIWlNB97eAVY iXrgGt307T71IunAq6B6o+H+n6JFEuSZE9BO/LPOCT1zWxU3EKEk2RWYlVbnWyTGTY5/ jzm0v54tQtyns5d+SZwYIwc+mXGNgt3GbSGQdB9b2Fzgs24PeJ5ZYJQM2pfH+Fr/8PaN lJ+yXy1amuSwA/gqmU1sDdK+wwuU0sKXSAYjcj/axSH6qkL1VfGdNiiTu26xkjZTtG5x pitzYLOmh+MfvpkxIR2o4lck8KOv7sSAo1PWtah4P0fgynoIbrLu8tWOpgZG/zOIln+S zbyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=7mKulXr3uDNZlrIhyy1TrsBgCnNjTvD4XIs4ViOsPIM=; b=XxVPAnEMgOibL5iknV9A7k+JmZzEO6Ht2sbMQqmyOEcwnP/pLp9prabs8jpm2sST12 FXaSPBy9DAMuPai2cViZw8Zt9dRUnGMCZhFegZ3SB0vYkV8A6m59/4AFjOvbHaS9x4Iw TcYizUxuUA3Fp1CVA0WLOUqvi+fuaUvzi392F4M5/NAYYb2ZwtAGg4iIslvhv6WYwPwv vpaIUi6kcP2hePmP3AxuUAiPBq2TFmv0hBQWQ4OPvM8SZAyr8K0LUd5d02dfOfpQB8Kf eB8bS+cDGh3xEWaKjAaA23jwB0qwbsOUb7Ju3lzOcAWI6FhxwNE+VK19mids/pmm9gAW 1nmQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32si12330927pgk.309.2019.02.12.06.56.36; Tue, 12 Feb 2019 06:56:53 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728631AbfBLOez (ORCPT + 99 others); Tue, 12 Feb 2019 09:34:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbfBLOez (ORCPT ); Tue, 12 Feb 2019 09:34:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED2F2C0587DA; Tue, 12 Feb 2019 14:34:54 +0000 (UTC) Received: from darcari.bos.com (ovpn-117-78.phx2.redhat.com [10.3.117.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B28819743; Tue, 12 Feb 2019 14:34:54 +0000 (UTC) From: David Arcari To: linux-pm@vger.kernel.org Cc: David Arcari , Len Brown , Jirka Hladky , linux-kernel@vger.kernel.org Subject: [PATCH] tools/power turbostat: return the exit status of a command Date: Tue, 12 Feb 2019 09:34:39 -0500 Message-Id: <1549982079-23516-1-git-send-email-darcari@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Feb 2019 14:34:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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() -- 1.8.3.1