Tetsuro IKEDA
null+****@clear*****
Thu Oct 4 10:18:52 JST 2012
Tetsuro IKEDA 2009-06-18 14:46:07 +0900 (Thu, 18 Jun 2009) New Revision: b452f4e80d196d49462ae78160b0920127371b97 https://github.com/mroonga/mroonga/commit/b452f4e80d196d49462ae78160b0920127371b97 Log: add error check for grn_init. Modified files: driver.c ha_groonga.cc Modified: driver.c (+8 -4) =================================================================== --- driver.c 2009-06-18 14:36:47 +0900 (d9641d5) +++ driver.c 2009-06-18 14:46:07 +0900 (cb64485) @@ -44,17 +44,20 @@ int mrn_flush_logs() int mrn_init() { + grn_ctx ctx; + /* libgroonga init */ - grn_init(); - mrn_ctx_init(); + if (grn_init() != GRN_SUCCESS) { + return -1; + } + grn_ctx_init(ctx,0); /* log init */ if (!(mrn_logfile = fopen(mrn_logfile_name, "a"))) { return -1; } grn_logger_info_set(mrn_ctx_tls, &mrn_logger_info); - MRN_LOG(GRN_LOG_NOTICE, "++++++ starting mroonga ++++++"); - MRN_TRACE; + GRN_LOG(ctx, GRN_LOG_NOTICE, "++++++ starting mroonga ++++++"); /* init meta-data repository */ mrn_hash_sys = grn_hash_create(mrn_ctx_tls,NULL, @@ -67,6 +70,7 @@ int mrn_init() // TODO: FIX THIS //pthread_mutex_init(mrn_mutex_sys, PTHREAD_MUTEX_INITIALIZER); + grn_ctx_fin(ctx); return 0; } Modified: ha_groonga.cc (+0 -2) =================================================================== --- ha_groonga.cc 2009-06-18 14:36:47 +0900 (a05fe72) +++ ha_groonga.cc 2009-06-18 14:46:07 +0900 (51db880) @@ -120,8 +120,6 @@ mysql_declare_plugin(mroonga) } mysql_declare_plugin_end; - - /* handler implementation */ ha_groonga::ha_groonga(handlerton *hton, TABLE_SHARE *share) :handler(hton, share) -------------- next part -------------- HTML����������������������������...Download