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:
fryshorts 2015-05-06 21:15:24 +02:00
parent ee284a56ac
commit f5568ff586

View File

@ -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();