mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 14:10:11 +01:00
Global: don't require sysinfo.h globally
... which is Linux specific
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
#include "processes.h"
|
||||
|
||||
uint32_t ffDetectProcesses(FFinstance* instance, FFstrbuf* error)
|
||||
#include <sys/sysinfo.h>
|
||||
|
||||
uint32_t ffDetectProcesses(FFstrbuf* error)
|
||||
{
|
||||
#if FF_HAVE_SYSINFO_H
|
||||
FF_UNUSED(error);
|
||||
return (uint32_t) instance->state.sysinfo.procs;
|
||||
#else
|
||||
ffStrbufAppendS(error, "Unimplemented");
|
||||
return 0;
|
||||
#endif
|
||||
struct sysinfo info;
|
||||
if(sysinfo(&info) != 0)
|
||||
ffStrbufAppendS(error, "sysinfo() failed");
|
||||
return (uint32_t) info.procs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user