From 1921b62a7bb7b22f9c7841c893bcf8ac5bdabca1 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 1 Dec 2005 22:40:13 +0000 Subject: [PATCH] fix osx description --- .../java/src/net/hyperic/sigar/OperatingSystem.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/OperatingSystem.java b/bindings/java/src/net/hyperic/sigar/OperatingSystem.java index 61bd6d70..64de9a8b 100644 --- a/bindings/java/src/net/hyperic/sigar/OperatingSystem.java +++ b/bindings/java/src/net/hyperic/sigar/OperatingSystem.java @@ -158,10 +158,10 @@ public class OperatingSystem { os.type = TYPE_MACOSX; os.name = NAME_MACOSX; os.vendor = "Apple"; - if (os.version.equals("10.4")) { + if (os.version.startsWith("10.4")) { os.vendorCodeName = "Tiger"; } - else if (os.version.equals("10.3")) { + else if (os.version.startsWith("10.3")) { os.vendorCodeName = "Panther"; } } @@ -200,8 +200,13 @@ public class OperatingSystem { //"HP-UX 11" return this.vendorName + " " + this.vendorVersion; case TYPE_MACOSX: - //"Mac OS X 10.4" - return this.vendorName + " " + this.vendorCodeName; + //"Mac OS X Tiger" + if (this.vendorCodeName != null) { + return this.vendorName + " " + this.vendorCodeName; + } + else { + return this.vendorName; + } case TYPE_WIN32: //"Microsoft Windows 2003" return this.vendor + " Windows " + this.vendorVersion;