Skip to content

Commit 63e03ef

Browse files
darcarigregkh
authored andcommitted
tools/power turbostat: return the exit status of a command
[ Upstream commit 2a95496 ] 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 <[email protected]> Acked-by: Len Brown <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 3a3e675 commit 63e03ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,6 +3089,9 @@ int fork_it(char **argv)
30893089
signal(SIGQUIT, SIG_IGN);
30903090
if (waitpid(child_pid, &status, 0) == -1)
30913091
err(status, "waitpid");
3092+
3093+
if (WIFEXITED(status))
3094+
status = WEXITSTATUS(status);
30923095
}
30933096
/*
30943097
* n.b. fork_it() does not check for errors from for_all_cpus()

0 commit comments

Comments
 (0)