KWSys 2024-11-23 (3e9b0b88)

Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 3e9b0b88c2284302a26073d30aafaffe8c99f320 (master).

Upstream Shortlog
-----------------

Brad King (1):
      5995fd7d SystemInformation: Ignore stderr from OS query tools
This commit is contained in:
KWSys Upstream
2024-11-23 15:14:49 -05:00
committed by Brad King
parent 9b1a873de8
commit 295f4b1de1

View File

@@ -4759,7 +4759,7 @@ std::string SystemInformationImplementation::ExtractValueFromSysCtl(
std::string SystemInformationImplementation::RunProcess(
std::vector<const char*> args)
{
std::string buffer;
std::string out;
// Run the application
kwsysProcess* gp = kwsysProcess_New();
@@ -4778,7 +4778,10 @@ std::string SystemInformationImplementation::RunProcess(
(pipe == kwsysProcess_Pipe_STDOUT ||
pipe == kwsysProcess_Pipe_STDERR))) // wait for 1s
{
buffer.append(data, length);
// Keep stdout, ignore stderr.
if (pipe == kwsysProcess_Pipe_STDOUT) {
out.append(data, length);
}
}
kwsysProcess_WaitForExit(gp, nullptr);
@@ -4808,7 +4811,7 @@ std::string SystemInformationImplementation::RunProcess(
if (result) {
std::cerr << "Error " << args[0] << " returned :" << result << "\n";
}
return buffer;
return out;
}
std::string SystemInformationImplementation::ParseValueFromKStat(