Tolerate empty /proc/cpuinfo

ci/unstable
Timo Röhling 2 years ago
parent 1bdd0dc870
commit 8d77acc002

@ -0,0 +1,25 @@
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Sun, 28 May 2023 12:02:38 +0200
Subject: Tolerate empty /proc/cpuinfo
Forwarded: https://gitlab.kitware.com/utils/kwsys/-/merge_requests/284
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8504
---
Source/kwsys/SystemInformation.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 20e2edb..7f8485e 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3453,6 +3453,10 @@ bool SystemInformationImplementation::RetrieveInformationFromCpuInfoFile()
fileSize++;
}
fclose(fd);
+ if (fileSize < 2) {
+ std::cout << "No data in /proc/cpuinfo" << std::endl;
+ return false;
+ }
buffer.resize(fileSize - 2);
// Number of logical CPUs (combination of multiple processors, multi-core
// and SMT)

@ -1 +1,2 @@
0001-Prefer-default-Python-version.patch
0002-Tolerate-empty-proc-cpuinfo.patch

Loading…
Cancel
Save