From db52f34d7df479a20567502b00aaf7cb554ad48a Mon Sep 17 00:00:00 2001 From: Daniel Malea Date: Fri, 27 Sep 2013 21:34:03 +0000 Subject: [PATCH] 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 --- lldb/source/Host/linux/Host.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index 17939ab6353b..c23e8e448714 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