Commit 25233e17 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'kwsys-process-api-fix'

eaceb8a9 paraview-mesa: fix usage of the kwsys Process API
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3230
parents b74d73b1 eaceb8a9
Pipeline #135735 failed with stage
in 0 seconds
...@@ -309,7 +309,31 @@ int main(int argc, char* argv[]) ...@@ -309,7 +309,31 @@ int main(int argc, char* argv[])
vtksysProcess_SetPipeShared(proc, vtksysProcess_Pipe_STDOUT, 1); vtksysProcess_SetPipeShared(proc, vtksysProcess_Pipe_STDOUT, 1);
vtksysProcess_SetPipeShared(proc, vtksysProcess_Pipe_STDERR, 1); vtksysProcess_SetPipeShared(proc, vtksysProcess_Pipe_STDERR, 1);
vtksysProcess_Execute(proc); vtksysProcess_Execute(proc);
int ret = vtksysProcess_GetExitValueByIndex(proc, 0); vtksysProcess_WaitForExit(proc, nullptr);
// Extract the result of the command.
int const state = vtksysProcess_GetState(proc);
int ret = EXIT_FAILURE;
if (state == vtksysProcess_State_Exited)
{
ret = vtksysProcess_GetExitValue(proc);
}
else if (state == vtksysProcess_State_Exception)
{
const char* exception_str = vtksysProcess_GetExceptionString(proc);
error("exception occurred: ", exception_str);
}
else if (state == vtksysProcess_State_Error)
{
const char* error_str = vtksysProcess_GetErrorString(proc);
error("process error: ", error_str);
}
else if (state == vtksysProcess_State_Expired)
{
error("timeout error", nullptr);
}
// Cleanup.
vtksysProcess_Delete(proc); vtksysProcess_Delete(proc);
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment