Skip to content

Commit

Permalink
Make omrsysinfo_get_CPU_load() return another error code on first call
Browse files Browse the repository at this point in the history
This is to help getSystemCpuLoad() determine if it's the first call.

Related: eclipse-openj9/openj9#18451

Signed-off-by: Gengchen Tuo <[email protected]>
  • Loading branch information
thallium committed Nov 22, 2023
1 parent 419dc95 commit 5058194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion port/unix/omrsysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5058194

Please sign in to comment.