mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
libobs: Split up processor logging on nix
Split the function logging the processor information on nix into two parts. The part logging the number of logical cores is portable and works on all systems that support POSIX.1 while the other part is specific to linux.
This commit is contained in:
+7
-3
@@ -81,6 +81,12 @@ char *find_libobs_data_file(const char *file)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void log_processor_cores(void)
|
||||
{
|
||||
blog(LOG_INFO, "Processor: %lu logical cores",
|
||||
sysconf(_SC_NPROCESSORS_ONLN));
|
||||
}
|
||||
|
||||
static void log_processor_info(void)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -90,9 +96,6 @@ static void log_processor_info(void)
|
||||
size_t linecap = 0;
|
||||
struct dstr processor;
|
||||
|
||||
blog(LOG_INFO, "Processor: %lu logical cores",
|
||||
sysconf(_SC_NPROCESSORS_ONLN));
|
||||
|
||||
fp = fopen("/proc/cpuinfo", "r");
|
||||
if (!fp)
|
||||
return;
|
||||
@@ -191,6 +194,7 @@ static void log_distribution_info(void)
|
||||
|
||||
void log_system_info(void)
|
||||
{
|
||||
log_processor_cores();
|
||||
log_processor_info();
|
||||
log_memory_info();
|
||||
log_kernel_version();
|
||||
|
||||
Reference in New Issue
Block a user