Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 742007f

Browse files
darcarigregkh
authored andcommitted
tools/power turbostat: return the exit status of a command
[ Upstream commit 2a95496634a017c19641f26f00907af75b962f01 ] turbostat failed to return a non-zero exit status even though the supplied command (turbostat <command>) 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 <darcari@redhat.com> Acked-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b916409 commit 742007f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,9 @@ int fork_it(char **argv)
23472347
signal(SIGQUIT, SIG_IGN);
23482348
if (waitpid(child_pid, &status, 0) == -1)
23492349
err(status, "waitpid");
2350+
2351+
if (WIFEXITED(status))
2352+
status = WEXITSTATUS(status);
23502353
}
23512354
/*
23522355
* n.b. fork_it() does not check for errors from for_all_cpus()

0 commit comments

Comments
 (0)