summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/ctx.c')
-rw-r--r--libglusterfs/src/ctx.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libglusterfs/src/ctx.c b/libglusterfs/src/ctx.c
index 1e4c341df05..3d890b04ec9 100644
--- a/libglusterfs/src/ctx.c
+++ b/libglusterfs/src/ctx.c
@@ -10,21 +10,19 @@
#include <pthread.h>
-#include "globals.h"
-#include "glusterfs.h"
+#include "glusterfs/globals.h"
+#include "glusterfs/glusterfs.h"
#include "timer-wheel.h"
glusterfs_ctx_t *
glusterfs_ctx_new()
{
- int ret = 0;
glusterfs_ctx_t *ctx = NULL;
/* no GF_CALLOC here, gf_acct_mem_set_enable is not
yet decided at this point */
- ctx = calloc(1, sizeof(*ctx));
+ ctx = CALLOC(1, sizeof(*ctx));
if (!ctx) {
- ret = -1;
goto out;
}
@@ -39,13 +37,16 @@ glusterfs_ctx_new()
ctx->log.loglevel = DEFAULT_LOG_LEVEL;
-#ifdef RUN_WITH_VALGRIND
- ctx->cmd_args.valgrind = _gf_true;
+#if defined(RUN_WITH_MEMCHECK)
+ ctx->cmd_args.vgtool = _gf_memcheck;
+#elif defined(RUN_WITH_DRD)
+ ctx->cmd_args.vgtool = _gf_drd;
+#else
+ ctx->cmd_args.vgtool = _gf_none;
#endif
/* lock is never destroyed! */
- ret = LOCK_INIT(&ctx->lock);
- if (ret) {
+ if (LOCK_INIT(&ctx->lock)) {
free(ctx);
ctx = NULL;
goto out;