From 5058194be04523adaa0baf32e2be22adc3697eb3 Mon Sep 17 00:00:00 2001 From: Gengchen Tuo Date: Wed, 22 Nov 2023 10:31:42 -0500 Subject: [PATCH] Make omrsysinfo_get_CPU_load() return another error code on first call This is to help getSystemCpuLoad() determine if it's the first call. Related: https://github.com/eclipse-openj9/openj9/pull/18451 Signed-off-by: Gengchen Tuo --- port/unix/omrsysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/unix/omrsysinfo.c b/port/unix/omrsysinfo.c index 2fa15bd651f..29466716b6f 100644 --- a/port/unix/omrsysinfo.c +++ b/port/unix/omrsysinfo.c @@ -4642,7 +4642,7 @@ omrsysinfo_get_CPU_load(struct OMRPortLibrary *portLibrary, double *cpuLoad) if (oldestCPUTime->timestamp == 0) { *oldestCPUTime = currentCPUTime; *latestCPUTime = currentCPUTime; - return OMRPORT_ERROR_OPFAILED; + return OMRPORT_ERROR_INVALID; } /* Calculate using the most recent value in the history */