summaryrefslogtreecommitdiffstats
path: root/geo-replication/src/gsyncd.c
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2014-05-06 16:04:43 +0530
committerVenky Shankar <vshankar@redhat.com>2014-05-06 23:45:12 -0700
commitb8cd471dbaadfa6ff9a92789f8fd670c144f9e9e (patch)
tree4c7c383444e9a26c6426e2edd7417608427d34c3 /geo-replication/src/gsyncd.c
parent199435aac3be170f6dadd4e88a576cec808ee419 (diff)
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 <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/7683 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication/src/gsyncd.c')
-rw-r--r--geo-replication/src/gsyncd.c15
1 files changed, 11 insertions, 4 deletions
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_);