mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
CPUUsage: don't hang on weird host
Try fixing CI of FreeBSD
This commit is contained in:
@@ -27,6 +27,7 @@ const char* ffGetCpuUsageResult(FFlist* result)
|
||||
if(cpuTimes1.length == 0) return "No CPU cores found";
|
||||
|
||||
FF_LIST_AUTO_DESTROY cpuTimes2 = ffListCreate(sizeof(FFCpuUsageInfo));
|
||||
uint32_t retryCount = 0;
|
||||
|
||||
retry:
|
||||
error = ffGetCpuUsageInfo(&cpuTimes2);
|
||||
@@ -41,6 +42,8 @@ retry:
|
||||
{
|
||||
ffListClear(&cpuTimes2);
|
||||
ffTimeSleep(200);
|
||||
if (++retryCount >= 10)
|
||||
return "Retry count exceeded";
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user