diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 2 | ||||
-rw-r--r-- | cli/src/cli.c | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ef0dd839c..92361e6de 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3730,7 +3730,7 @@ cmd_profile_volume_brick_out (dict_t *dict, int count, int interval) snprintf (key, sizeof (key), "%d-%d-%d-maxlatency", count, interval, i); ret = dict_get_double (dict, key, &profile_info[i].max_latency); - profile_info[i].fop_name = gf_fop_list[i]; + profile_info[i].fop_name = (char *)gf_fop_list[i]; total_percentage_latency += (profile_info[i].fop_hits * profile_info[i].avg_latency); diff --git a/cli/src/cli.c b/cli/src/cli.c index ccbc88f02..380a57f48 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -173,12 +173,12 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx) static int -logging_init (struct cli_state *state) +logging_init (glusterfs_ctx_t *ctx, struct cli_state *state) { char *log_file = state->log_file ? state->log_file : DEFAULT_CLI_LOG_FILE_DIRECTORY "/cli.log"; - if (gf_log_init (log_file) == -1) { + if (gf_log_init (ctx, log_file) == -1) { fprintf (stderr, "ERROR: failed to open logfile %s\n", log_file); return -1; @@ -548,13 +548,16 @@ main (int argc, char *argv[]) int ret = -1; glusterfs_ctx_t *ctx = NULL; - ret = glusterfs_globals_init (); - if (ret) - return ret; - ctx = glusterfs_ctx_new (); if (!ctx) return ENOMEM; + + gf_mem_acct_enable_set (ctx); + + ret = glusterfs_globals_init (ctx); + if (ret) + return ret; + THIS->ctx = ctx; ret = glusterfs_ctx_defaults_init (ctx); @@ -572,7 +575,7 @@ main (int argc, char *argv[]) if (ret) goto out; - ret = logging_init (&state); + ret = logging_init (ctx, &state); if (ret) goto out; |