[Groonga-commit] groonga/groonga [master] Extract default hostname set code

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Mon Nov 5 22:22:47 JST 2012


Kouhei Sutou	2012-11-05 22:22:47 +0900 (Mon, 05 Nov 2012)

  New Revision: ff46d020e99b207a626e6782fb4e9597028082ea
  https://github.com/groonga/groonga/commit/ff46d020e99b207a626e6782fb4e9597028082ea

  Log:
    Extract default hostname set code

  Modified files:
    src/groonga.c

  Modified: src/groonga.c (+17 -13)
===================================================================
--- src/groonga.c    2012-11-05 19:10:25 +0900 (1f6277c)
+++ src/groonga.c    2012-11-05 22:22:47 +0900 (fac4d10)
@@ -1776,20 +1776,8 @@ static int64_t default_default_match_escalation_threshold = 0;
 static const char * const default_bind_address = "0.0.0.0";
 
 static void
-init_default_settings(void)
+init_default_hostname(void)
 {
-  output = stdout;
-
-  default_encoding = grn_strtoenc(GRN_DEFAULT_ENCODING);
-
-  {
-    const uint32_t num_cores = get_core_number();
-    if (num_cores != 0) {
-      default_max_num_threads = num_cores;
-    }
-  }
-
-  {
     static char hostname[HOST_NAME_MAX + 1];
     hostname[HOST_NAME_MAX] = '\0';
     if (gethostname(hostname, HOST_NAME_MAX)) {
@@ -1811,8 +1799,24 @@ init_default_settings(void)
         default_hostname = hostname;
       }
     }
+}
+
+static void
+init_default_settings(void)
+{
+  output = stdout;
+
+  default_encoding = grn_strtoenc(GRN_DEFAULT_ENCODING);
+
+  {
+    const uint32_t num_cores = get_core_number();
+    if (num_cores != 0) {
+      default_max_num_threads = num_cores;
+    }
   }
 
+  init_default_hostname();
+
   if (grn_log_path) {
     default_log_path = grn_log_path;
   }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index