From 19dd1a0ea6fed11b40cb9f83adbce17c04d569f3 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 10 May 2018 10:46:03 +0000 Subject: Convert all RunShellCommand functions to use the Timeout class this completes the Timeout migration started in r331880 with the Predicate class. llvm-svn: 331970 --- lldb/source/Commands/CommandObjectPlatform.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lldb/source/Commands') diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 379e8507f4e..0c979032708 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -1692,7 +1692,7 @@ class CommandObjectPlatformShell : public CommandObjectRaw { public: class CommandOptions : public Options { public: - CommandOptions() : Options(), timeout(10) {} + CommandOptions() : Options() {} ~CommandOptions() override = default; @@ -1708,11 +1708,13 @@ public: switch (short_option) { case 't': - timeout = 10; - if (option_arg.getAsInteger(10, timeout)) + uint32_t timeout_sec; + if (option_arg.getAsInteger(10, timeout_sec)) error.SetErrorStringWithFormat( "could not convert \"%s\" to a numeric value.", option_arg.str().c_str()); + else + timeout = std::chrono::seconds(timeout_sec); break; default: error.SetErrorStringWithFormat("invalid short option character '%c'", @@ -1725,7 +1727,7 @@ public: void OptionParsingStarting(ExecutionContext *execution_context) override {} - uint32_t timeout; + Timeout timeout = std::chrono::seconds(10); }; CommandObjectPlatformShell(CommandInterpreter &interpreter) -- cgit v1.2.3