Kouhei Sutou
null+****@clear*****
Sun Oct 18 16:35:00 JST 2015
Kouhei Sutou 2015-10-18 16:35:00 +0900 (Sun, 18 Oct 2015) New Revision: 728799520a597c9c749ad9dbf3fe5e1a49a9e6ae https://github.com/groonga/groonga/commit/728799520a597c9c749ad9dbf3fe5e1a49a9e6ae Message: Remove conf file on remove Modified files: lib/db.c Modified: lib/db.c (+14 -0) =================================================================== --- lib/db.c 2015-10-18 16:16:18 +0900 (494ea62) +++ lib/db.c 2015-10-18 16:35:00 +0900 (537292f) @@ -217,6 +217,15 @@ grn_db_conf_open(grn_ctx *ctx, grn_db *s, const char *path) } } +static grn_rc +grn_db_conf_remove(grn_ctx *ctx, const char *path) +{ + char conf_path[PATH_MAX]; + + grn_snprintf(conf_path, PATH_MAX, PATH_MAX, GRN_DB_CONF_PATH_FORMAT, path); + return grn_hash_remove(ctx, conf_path); +} + grn_obj * grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg) { @@ -8613,6 +8622,11 @@ _grn_obj_remove_db(grn_ctx *ctx, grn_obj *obj, grn_obj *db, grn_id id, rc = grn_dat_remove(ctx, path); break; } + if (rc == GRN_SUCCESS) { + rc = grn_db_conf_remove(ctx, path); + } else { + grn_db_conf_remove(ctx, path); + } } return rc; -------------- next part -------------- HTML����������������������������... Download