From b8cd471dbaadfa6ff9a92789f8fd670c144f9e9e Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 6 May 2014 16:04:43 +0530 Subject: gsyncd / geo-rep: Initialize default memory accounting commit 7fba3a8 enables memory accounting by default. Since geo-replication binary (gsyncd) does not declare a memory accounting function, call like GF_{CALLOC,MALLOC} result int asserts. This patch initializes default memory accounting. Change-Id: I9ad1de8bca6745a9899a006a863a7cfeef73d52f BUG: 1094708 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/7683 Reviewed-by: Kotresh HR Reviewed-by: Vijay Bellur --- geo-replication/src/gsyncd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/src/gsyncd.c b/geo-replication/src/gsyncd.c index 0830e7f9bcc..21864db4af2 100644 --- a/geo-replication/src/gsyncd.c +++ b/geo-replication/src/gsyncd.c @@ -29,6 +29,7 @@ #ifdef USE_LIBGLUSTERFS #include "glusterfs.h" #include "globals.h" +#include "defaults.h" #endif #include "common-utils.h" @@ -341,10 +342,11 @@ struct invocable invocables[] = { int main (int argc, char **argv) { - char *evas = NULL; - struct invocable *i = NULL; - char *b = NULL; - char *sargv = NULL; + int ret = -1; + char *evas = NULL; + struct invocable *i = NULL; + char *b = NULL; + char *sargv = NULL; #ifdef USE_LIBGLUSTERFS glusterfs_ctx_t *ctx = NULL; @@ -357,6 +359,11 @@ main (int argc, char **argv) return 1; THIS->ctx = ctx; + ret = default_mem_acct_init (THIS); + if (ret) { + fprintf (stderr, "internal error: mem accounting failed\n"); + return 1; + } #endif evas = getenv (_GLUSTERD_CALLED_); -- cgit