diff options
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
| -rw-r--r-- | lldb/source/Host/common/Host.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index ac4593484f3..49f1f045aab 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -536,18 +536,15 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir, error.SetErrorString("failed to get process ID"); if (error.Success()) { - bool timed_out = false; - shell_info_sp->process_reaped.WaitForValueEqualTo( - true, std::chrono::seconds(timeout_sec), &timed_out); - if (timed_out) { + if (!shell_info_sp->process_reaped.WaitForValueEqualTo( + true, std::chrono::seconds(timeout_sec))) { error.SetErrorString("timed out waiting for shell command to complete"); // Kill the process since it didn't complete within the timeout specified Kill(pid, SIGKILL); // Wait for the monitor callback to get the message - timed_out = false; shell_info_sp->process_reaped.WaitForValueEqualTo( - true, std::chrono::seconds(1), &timed_out); + true, std::chrono::seconds(1)); } else { if (status_ptr) *status_ptr = shell_info_sp->status; |

