diff options
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
| -rw-r--r-- | lldb/source/Host/common/Host.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 49f1f045aab..becd914650b 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -536,8 +536,11 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir, error.SetErrorString("failed to get process ID"); if (error.Success()) { - if (!shell_info_sp->process_reaped.WaitForValueEqualTo( - true, std::chrono::seconds(timeout_sec))) { + // TODO: Remove this and make the function take Timeout<> argument. + Timeout<std::micro> timeout(llvm::None); + if (timeout_sec != 0) + timeout = std::chrono::seconds(timeout_sec); + if (!shell_info_sp->process_reaped.WaitForValueEqualTo(true, timeout)) { error.SetErrorString("timed out waiting for shell command to complete"); // Kill the process since it didn't complete within the timeout specified |

