瀏覽代碼

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 年之前
父節點
當前提交
f5568ff586
共有 1 個文件被更改,包括 7 次插入3 次删除
  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();