Skip to content

Commit a8d230b

Browse files
committed
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: eclipse-openj9/openj9#18451 Signed-off-by: Gengchen Tuo <[email protected]>
1 parent 419dc95 commit a8d230b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include_core/omrporterror.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#define OMRPORT_ERROR_INVALID_HANDLE (OMRPORT_ERROR_BASE-17)
6868
#define OMRPORT_ERROR_NOT_SUPPORTED_ON_THIS_PLATFORM (OMRPORT_ERROR_BASE-18)
6969
#define OMRPORT_ERROR_INVALID_ARGUMENTS (OMRPORT_ERROR_BASE-19)
70+
#define OMRPORT_ERROR_INSUFFICIENT_DATA (OMRPORT_ERROR_BASE-20)
7071
/** @} */
7172

7273
/**

port/unix/omrsysinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4642,7 +4642,7 @@ omrsysinfo_get_CPU_load(struct OMRPortLibrary *portLibrary, double *cpuLoad)
46424642
if (oldestCPUTime->timestamp == 0) {
46434643
*oldestCPUTime = currentCPUTime;
46444644
*latestCPUTime = currentCPUTime;
4645-
return OMRPORT_ERROR_OPFAILED;
4645+
return OMRPORT_ERROR_INSUFFICIENT_DATA;
46464646
}
46474647

46484648
/* Calculate using the most recent value in the history */

0 commit comments

Comments
 (0)