Ver código fonte

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.
fryshorts 10 anos atrás
pai
commit
f5568ff586
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      libobs/obs-nix.c

+ 7 - 3
libobs/obs-nix.c

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