summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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