From 351754816dc884011d5bc802a7c182ea30b550ab Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 16 Jun 2005 22:45:41 +0000 Subject: [PATCH] set vendorCodeName for redhat --- .../java/src/net/hyperic/sigar/OperatingSystem.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/OperatingSystem.java b/bindings/java/src/net/hyperic/sigar/OperatingSystem.java index e22d00c1..cabaf42b 100644 --- a/bindings/java/src/net/hyperic/sigar/OperatingSystem.java +++ b/bindings/java/src/net/hyperic/sigar/OperatingSystem.java @@ -272,11 +272,19 @@ public class OperatingSystem { public void parse(String line, OperatingSystem os) { super.parse(line, os); + int ix = line.indexOf("("); + if (ix != -1) { + String codeName = line.substring(ix+1); + ix = codeName.indexOf(")"); + codeName = codeName.substring(0, ix); + os.vendorCodeName = codeName; + } + String token = "Red Hat Enterprise Linux "; if (line.startsWith(token)) { line = line.substring(token.length()); - int ix = line.indexOf(" "); //'AS' or 'ES' + ix = line.indexOf(" "); //'AS' or 'ES' os.vendorVersion = line.substring(0, ix) + " " + os.vendorVersion; }