This commit is contained in:
Thulinma 2024-06-17 13:47:48 +02:00
parent f96a7201cf
commit 110c1a0013
2 changed files with 8 additions and 4 deletions

View file

@ -385,7 +385,7 @@ void Controller::SharedMemStats(void *config){
while (((Util::Config *)config)->is_active){
{
std::ifstream cpustat("/proc/stat");
if (cpustat){
if (cpustat.good()){
char line[300];
while (cpustat.getline(line, 300)){
static uint64_t cl_total = 0, cl_idle = 0;
@ -403,6 +403,7 @@ void Controller::SharedMemStats(void *config){
}
}
}
cpustat.close();
}
{
tthread::lock_guard<tthread::mutex> guard(Controller::configMutex);