[Groonga-commit] groonga/groonga at fe935f6 [master] Reduce variable scope

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Mon May 27 11:43:04 JST 2013


Kouhei Sutou	2013-05-27 11:43:04 +0900 (Mon, 27 May 2013)

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

  Message:
    Reduce variable scope

  Modified files:
    src/groonga.c

  Modified: src/groonga.c (+3 -1)
===================================================================
--- src/groonga.c    2013-05-27 11:18:00 +0900 (5c9dacb)
+++ src/groonga.c    2013-05-27 11:43:04 +0900 (4ba1723)
@@ -82,7 +82,6 @@ static int useql;
 static grn_bool is_daemon_mode = GRN_FALSE;
 static int (*do_client)(int argc, char **argv);
 static int (*do_server)(char *path);
-static FILE *pid_file = NULL;
 static const char *pid_file_path = NULL;
 static const char *input_path = NULL;
 static FILE *output = NULL;
@@ -433,6 +432,8 @@ daemonize(void)
   }
   switch (fork()) {
   case 0:
+    {
+      FILE *pid_file = NULL;
     if (pid_file_path) {
       pid_file = fopen(pid_file_path, "w");
     }
@@ -444,6 +445,7 @@ daemonize(void)
       fclose(pid_file);
       pid_file = NULL;
     }
+    }
     break;
   case -1:
     perror("fork");
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る