summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-09-27 21:34:03 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-09-27 21:34:03 +0000
commitdb52f34d7df479a20567502b00aaf7cb554ad48a (patch)
tree7444c67e54ceb01dd45bc8029668b6ec8483c870
parent102f82a74eb9916a8ba67e210947e12b7fc8a142 (diff)
downloadbcm5719-llvm-db52f34d7df479a20567502b00aaf7cb554ad48a.tar.gz
bcm5719-llvm-db52f34d7df479a20567502b00aaf7cb554ad48a.zip
Fix OS Version reporting bug detected by TestPlatform for some Linux 3.x kernels that do not report the update version
- should resolve the current failure on the Linux clang buildbot llvm-svn: 191568
-rw-r--r--lldb/source/Host/linux/Host.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index 17939ab6353..c23e8e44871 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -213,7 +213,14 @@ Host::GetOSVersion(uint32_t &major,
return false;
status = sscanf(un.release, "%u.%u.%u", &major, &minor, &update);
- return status == 3;
+ if (status == 3)
+ return true;
+
+ // Some kernels omit the update version, so try looking for just "X.Y" and
+ // set update to 0.
+ update = 0;
+ status = sscanf(un.release, "%u.%u", &major, &minor);
+ return status == 2;
}
lldb::DataBufferSP
OpenPOWER on IntegriCloud