diff --git a/plugins/admin/admin-commands.c b/plugins/admin/admin-commands.c index 8db62de..28f3cec 100644 --- a/plugins/admin/admin-commands.c +++ b/plugins/admin/admin-commands.c @@ -1259,8 +1259,13 @@ void admin_set_config(network_mysqld_con* con, char* key, char* value) static void admin_reload_settings(network_mysqld_con* con) { GList *options = admin_get_all_options(con->srv); - - if (!chassis_config_reload_options(con->srv->config_manager)) { + gint ret = chassis_config_reload_options(con->srv->config_manager); + if (ret == -1) { + network_mysqld_con_send_error(con->client, + C("Can't connect to remote or can't get config")); + return; + } + if (ret == -2) { network_mysqld_con_send_error(con->client, C("Can't load options, only support remote config")); return; diff --git a/src/chassis-config.c b/src/chassis-config.c index 8e5cab6..b2dfbed 100644 --- a/src/chassis-config.c +++ b/src/chassis-config.c @@ -320,14 +320,18 @@ chassis_config_load_options_mysql(chassis_config_t *conf) return FALSE; } -gboolean chassis_config_reload_options(chassis_config_t *conf) +gint chassis_config_reload_options(chassis_config_t *conf) { switch (conf->type) { case CHASSIS_CONF_MYSQL: - return chassis_config_load_options_mysql(conf); + if(chassis_config_load_options_mysql(conf)) { + return 0; + } else { + return -1; + } default: /* TODO g_critical(G_STRLOC " not implemented"); */ - return FALSE; + return -2; } } diff --git a/src/chassis-config.h b/src/chassis-config.h index 4b1532c..eb468a0 100644 --- a/src/chassis-config.h +++ b/src/chassis-config.h @@ -36,7 +36,7 @@ chassis_config_t *chassis_config_from_local_dir(char *dir, char *conf_file); void chassis_config_free(chassis_config_t *); -gboolean chassis_config_reload_options(chassis_config_t *conf); +gint chassis_config_reload_options(chassis_config_t *conf); GHashTable *chassis_config_get_options(chassis_config_t *);