Navigation Menu

Skip to content

Commit

Permalink
add error check for grn_init.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdttr committed Jun 18, 2009
1 parent fb7c00a commit b452f4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 8 additions & 4 deletions driver.c
Expand Up @@ -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,
Expand All @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions ha_groonga.cc
Expand Up @@ -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)
Expand Down

0 comments on commit b452f4e

Please sign in to comment.