tools/power turbostat: return the exit status of a command
PATCH 1/1 tools/power turbostat: return the exit status of a command
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.
--- tools/power/x86/turbostat/turbostat.c | 3 +++ 1 file changed, 3 insertions(+)
tools/power/x86/turbostat/turbostat.c +3 -0
@@ -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()
Signature · 1 line
1.8.3.1
ping -- just want to make sure this doesn't get lost.
Thanks!
Quoted 28 lines · David Arcari
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]>Cc Len Brown <[email protected]>Cc Jirka Hladky <[email protected]>--- tools/power/x86/turbostat/turbostat.c | 3 +++ 1 file changed, 3 insertions(+)tools/power/x86/turbostat/turbostat.c +3
-0@@ -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()
Quoted 36 lines · David Arcari
ping -- just want to make sure this doesn't get lost.
Thanks!
Quoted 28 lines · David Arcari
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]>Cc Len Brown <[email protected]>Cc Jirka Hladky <[email protected]>--- tools/power/x86/turbostat/turbostat.c | 3 +++ 1 file changed, 3 insertions(+)tools/power/x86/turbostat/turbostat.c +3
-0@@ -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()
Signature · 1 line
Len Brown, Intel Open Source Technology Center
Rafael J. Wysocki
AppliedQuoted 19 lines · CET David Arcari
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]>Cc Len Brown <[email protected]>Cc Jirka Hladky <[email protected]>--- tools/power/x86/turbostat/turbostat.c | 3 +++ 1 file changed, 3 insertions(+)tools/power/x86/turbostat/turbostat.c +0
-0
tools/power/x86/turbostat/turbostat.c int fork_it(char **argv) · line 5085
Quoted 9 lines
tools/power/x86/turbostat/turbostat.c +3
-0@@ -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!