summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-10-04 19:37:46 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-10-04 19:37:46 +0000
commita8c04469e53dda4440f44aca397299009928b7b9 (patch)
tree1c8f9adb380e75b22c07446839ccdf8fb5149a9c /lldb
parent4112b4733502f746b766861853c414af0e01d6f9 (diff)
downloadbcm5719-llvm-a8c04469e53dda4440f44aca397299009928b7b9.tar.gz
bcm5719-llvm-a8c04469e53dda4440f44aca397299009928b7b9.zip
[Host] Don't discard return value from RunShellCommand
The recent change to expand arguments with the user's shell sometimes caused a timeout and the error was not propagated. llvm-svn: 373776
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Host/macosx/objcxx/Host.mm11
-rw-r--r--lldb/source/Host/windows/Host.cpp10
2 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm
index 92aa4778fc6..d4c516d4659 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -1366,9 +1366,14 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
}
bool run_in_default_shell = true;
bool hide_stderr = true;
- RunShellCommand(expand_command, cwd, &status, nullptr, &output,
- std::chrono::seconds(10), run_in_default_shell,
- hide_stderr);
+ Status e = RunShellCommand(expand_command, cwd, &status, nullptr, &output,
+ std::chrono::seconds(10), run_in_default_shell,
+ hide_stderr);
+
+ if (e.Fail()) {
+ error.SetErrorString(e.AsCString());
+ return error;
+ }
if (status != 0) {
error.SetErrorStringWithFormat("lldb-argdumper exited with error %d",
diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp
index 19be271e831..1c6512bb348 100644
--- a/lldb/source/Host/windows/Host.cpp
+++ b/lldb/source/Host/windows/Host.cpp
@@ -226,8 +226,14 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
int status;
std::string output;
std::string command = expand_command.GetString();
- RunShellCommand(command.c_str(), launch_info.GetWorkingDirectory(), &status,
- nullptr, &output, std::chrono::seconds(10));
+ Status e =
+ RunShellCommand(command.c_str(), launch_info.GetWorkingDirectory(),
+ &status, nullptr, &output, std::chrono::seconds(10));
+
+ if (e.Fail()) {
+ error.SetErrorString(e.AsCString());
+ return error;
+ }
if (status != 0) {
error.SetErrorStringWithFormat("lldb-argdumper exited with error %d",
OpenPOWER on IntegriCloud