mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-01-26 19:09:06 +00:00
cmSystemTools: Remove unused timeout argument from WaitForLine
The only call sites just retries on timeout anyway.
This commit is contained in:
parent
12be5c60ff
commit
6f5bbf9ee7
@ -2,7 +2,6 @@
|
||||
file LICENSE.rst or https://cmake.org/licensing for details. */
|
||||
#include "cmCTestScriptHandler.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
@ -118,9 +117,8 @@ int cmCTestScriptHandler::ExecuteScript(std::string const& total_script_arg)
|
||||
std::vector<char> out;
|
||||
std::vector<char> err;
|
||||
std::string line;
|
||||
auto pipe =
|
||||
cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe, line,
|
||||
std::chrono::seconds(100), out, err);
|
||||
auto pipe = cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe,
|
||||
line, out, err);
|
||||
while (pipe != cmSystemTools::WaitForLineResult::None) {
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
"Output: " << line << "\n");
|
||||
@ -129,9 +127,8 @@ int cmCTestScriptHandler::ExecuteScript(std::string const& total_script_arg)
|
||||
} else if (pipe == cmSystemTools::WaitForLineResult::STDOUT) {
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, line << "\n");
|
||||
}
|
||||
pipe =
|
||||
cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe, line,
|
||||
std::chrono::seconds(100), out, err);
|
||||
pipe = cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe,
|
||||
line, out, err);
|
||||
}
|
||||
|
||||
// Properly handle output of the build command
|
||||
|
||||
@ -2788,8 +2788,7 @@ bool cmSystemTools::ListTar(std::string const& outFileName,
|
||||
|
||||
cmSystemTools::WaitForLineResult cmSystemTools::WaitForLine(
|
||||
uv_loop_t* loop, uv_stream_t* outPipe, uv_stream_t* errPipe,
|
||||
std::string& line, cmDuration timeout, std::vector<char>& out,
|
||||
std::vector<char>& err)
|
||||
std::string& line, std::vector<char>& out, std::vector<char>& err)
|
||||
{
|
||||
line.clear();
|
||||
auto outiter = out.begin();
|
||||
@ -2859,22 +2858,7 @@ cmSystemTools::WaitForLineResult cmSystemTools::WaitForLine(
|
||||
ReadData errData;
|
||||
auto errHandle = startRead(errPipe, errData);
|
||||
|
||||
cm::uv_timer_ptr timer;
|
||||
bool timedOut = false;
|
||||
timer.init(*loop, &timedOut);
|
||||
timer.start(
|
||||
[](uv_timer_t* handle) {
|
||||
auto* timedOutPtr = static_cast<bool*>(handle->data);
|
||||
*timedOutPtr = true;
|
||||
},
|
||||
static_cast<uint64_t>(timeout.count() * 1000.0), 0,
|
||||
cm::uv_update_time::no);
|
||||
|
||||
uv_run(loop, UV_RUN_ONCE);
|
||||
if (timedOut) {
|
||||
// Timeout has been exceeded.
|
||||
return WaitForLineResult::Timeout;
|
||||
}
|
||||
if (outData.Read) {
|
||||
processOutput.DecodeText(outData.Buffer.data(), outData.Buffer.size(),
|
||||
strdata, 1);
|
||||
|
||||
@ -374,13 +374,11 @@ public:
|
||||
None,
|
||||
STDOUT,
|
||||
STDERR,
|
||||
Timeout,
|
||||
};
|
||||
|
||||
/** a general output handler for libuv */
|
||||
static WaitForLineResult WaitForLine(uv_loop_t* loop, uv_stream_t* outPipe,
|
||||
uv_stream_t* errPipe, std::string& line,
|
||||
cmDuration timeout,
|
||||
std::vector<char>& out,
|
||||
std::vector<char>& err);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user