diff --git a/services/samgr/native/source/collect/common_event_collect.cpp b/services/samgr/native/source/collect/common_event_collect.cpp index 6f6ca8b8567dc6c4d6442c396ef088f5c3e90272..2b01a069b5dbd01a265610f64600caddab7f11bb 100644 --- a/services/samgr/native/source/collect/common_event_collect.cpp +++ b/services/samgr/native/source/collect/common_event_collect.cpp @@ -805,7 +805,7 @@ float CommonEventCollect::GetCpuUsage(const char* file, uint32_t interval) void CommonEventCollect::MonitorCpuUsageThread() { struct sysinfo info; - uint64_t coreNum = sysconf(_SC_NPROCESSORS_ONLN); + uint64_t coreNum = static_cast(sysconf(_SC_NPROCESSORS_ONLN)); uint64_t baseLoad = coreNum << CPU_LOAD_SHIFT; pthread_setname_np(pthread_self(), "OS_CPU_MONITOR");