[Groonga-commit] groonga/groonga [master] mruby: support disable by GRN_MRB_ENABLED=no environment variable

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 16 17:12:30 JST 2013


Kouhei Sutou	2013-01-16 17:12:30 +0900 (Wed, 16 Jan 2013)

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

  Merged 78e354e: Merge pull request #50 from groonga/mruby

  Log:
    mruby: support disable by GRN_MRB_ENABLED=no environment variable

  Modified files:
    lib/mrb.c

  Modified: lib/mrb.c (+10 -1)
===================================================================
--- lib/mrb.c    2013-01-16 16:47:14 +0900 (0b3655b)
+++ lib/mrb.c    2013-01-16 17:12:30 +0900 (ee9cf12)
@@ -28,13 +28,22 @@
 void
 grn_ctx_impl_mrb_init(grn_ctx *ctx)
 {
-  ctx->impl->mrb = mrb_open();
+  const char *grn_mrb_enabled;
+  grn_mrb_enabled = getenv("GRN_MRB_ENABLED");
+  if (!grn_mrb_enabled || strcmp(grn_mrb_enabled, "yes") == 0) {
+    ctx->impl->mrb = mrb_open();
+  } else {
+    ctx->impl->mrb = NULL;
+  }
 }
 
 void
 grn_ctx_impl_mrb_fin(grn_ctx *ctx)
 {
+  if (ctx->impl->mrb) {
     mrb_close(ctx->impl->mrb);
+    ctx->impl->mrb = NULL;
+  }
 }
 #else
 void
-------------- next part --------------
HTML����������������������������...
다운로드 



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