From ee0f0c774afcbdfa916a58e6c74fece2c0386011 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 2 Jan 2006 17:07:54 +0000 Subject: [PATCH] skip Totals if there is only 1 cpu --- bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java index 84b221e5..4ba522a9 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/CpuInfo.java @@ -62,8 +62,10 @@ public class CpuInfo extends SigarCommandBase { output(cpus[i]); } - println("Totals........"); - output(this.sigar.getCpuPerc()); + if (infos.length > 1) { + println("Totals........"); + output(this.sigar.getCpuPerc()); + } } public static void main(String[] args) throws Exception {