[Groonga-commit] groonga/groonga at 95026be [master] grndb: support lazy mruby initialization

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Mar 30 16:52:17 JST 2016


Kouhei Sutou	2016-03-30 16:52:17 +0900 (Wed, 30 Mar 2016)

  New Revision: 95026be05b7ae4b304bcb9ef0c5700182660e676
  https://github.com/groonga/groonga/commit/95026be05b7ae4b304bcb9ef0c5700182660e676

  Message:
    grndb: support lazy mruby initialization

  Modified files:
    src/grndb.c

  Modified: src/grndb.c (+8 -2)
===================================================================
--- src/grndb.c    2016-03-30 16:28:06 +0900 (d5a353e)
+++ src/grndb.c    2016-03-30 16:52:17 +0900 (4b21ed1)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2014 Brazil
+  Copyright(C) 2014-2016 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
 
 #include <grn_mrb.h>
 #include <grn_ctx_impl.h>
+#include <grn_ctx_impl_mrb.h>
 
 #include <mruby/variable.h>
 #include <mruby/array.h>
@@ -129,7 +130,12 @@ main(int argc, char **argv)
   {
     grn_ctx ctx;
     grn_ctx_init(&ctx, 0);
-    exit_code = run(&ctx, argc, argv);
+    grn_ctx_impl_mrb_ensure_init(&ctx);
+    if (ctx.rc == GRN_SUCCESS) {
+      exit_code = run(&ctx, argc, argv);
+    } else {
+      exit_code = EXIT_FAILURE;
+    }
     grn_ctx_fin(&ctx);
   }
 
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index