mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
guard get_nproc with FF_HAVE_SYSCONF_H
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
#include <pthread.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#ifndef HOST_NAME_MAX
|
||||
#define HOST_NAME_MAX 64
|
||||
#endif
|
||||
|
||||
const FFTitleResult* ffDetectTitle(const FFinstance* instance)
|
||||
{
|
||||
static FFTitleResult result;
|
||||
|
||||
+7
-2
@@ -110,8 +110,13 @@ void ffPrintCPU(FFinstance* instance)
|
||||
double infoMaxFreq = getGhz("/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq");
|
||||
double infoMinFreq = getGhz("/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq");
|
||||
|
||||
int numProcsOnline = get_nprocs();
|
||||
int numProcsAvailable = get_nprocs_conf();
|
||||
#if FF_HAVE_SYSINFO_H
|
||||
int numProcsOnline = get_nprocs();
|
||||
int numProcsAvailable = get_nprocs_conf();
|
||||
#else
|
||||
int numProcsOnline = 0;
|
||||
int numProcsAvailable = 0;
|
||||
#endif
|
||||
|
||||
int physicalCores = 1;
|
||||
sscanf(physicalCoresString.chars, "%i", &physicalCores);
|
||||
|
||||
Reference in New Issue
Block a user