# HG changeset patch # User Simon Tooke # Date 1492152312 14400 # Node ID 92612114d1ce16e519498da357ffb2006a3d02c3 # Parent 65fcc9af086ce8be7872a43f16576e696f90b338 Patch to fix COPR build This patch updates the spec file to build a dependent Java file required by the previous patch (Windows CPU agent) A syntax change is also added. diff -r 65fcc9af086c -r 92612114d1ce common/portability/src/main/java/com/redhat/thermostat/common/portability/PortableHost.java --- a/common/portability/src/main/java/com/redhat/thermostat/common/portability/PortableHost.java Thu Apr 13 23:25:41 2017 -0400 +++ b/common/portability/src/main/java/com/redhat/thermostat/common/portability/PortableHost.java Fri Apr 14 02:45:12 2017 -0400 @@ -54,7 +54,8 @@ PortableMemoryStat getMemoryStat(); - static final int CPU_TIMES_SIZE = 3; + // represents size of array with idle, system and user ticks or percentages + int CPU_TIMES_SIZE = 3; // returns an array (one row per CPU) of an array of ints (idle, system and user ticks) long[][] getCPUUsageTicks(); diff -r 65fcc9af086c -r 92612114d1ce common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java --- a/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java Thu Apr 13 23:25:41 2017 -0400 +++ b/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java Fri Apr 14 02:45:12 2017 -0400 @@ -37,6 +37,7 @@ package com.redhat.thermostat.common.portability.internal.windows; import com.redhat.thermostat.common.portability.internal.PortableNativeLibraryLoader; +import com.redhat.thermostat.common.portability.PortableHost; import com.redhat.thermostat.shared.config.OS; import java.nio.ByteBuffer; @@ -44,7 +45,6 @@ import java.util.HashMap; import java.util.Map; -import static com.redhat.thermostat.common.portability.PortableHost.CPU_TIMES_SIZE; /** * Utility class to access Windows native code @@ -267,7 +267,7 @@ * @return long[3] array of idle, system and user times (in ticks) */ long[] getSystemTimes() { - final long times[] = new long[CPU_TIMES_SIZE]; + final long times[] = new long[PortableHost.CPU_TIMES_SIZE]; getSystemTimes0(times); return times; } @@ -280,7 +280,7 @@ final int numProcessors = getCPUCount(); final int[][] procs = new int[numProcessors][]; for (int i=0; i