diff options
Diffstat (limited to 'xlators/features/marker/utils/src/gsyncd.c')
-rw-r--r-- | xlators/features/marker/utils/src/gsyncd.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/features/marker/utils/src/gsyncd.c b/xlators/features/marker/utils/src/gsyncd.c index cdf28267..a45873a7 100644 --- a/xlators/features/marker/utils/src/gsyncd.c +++ b/xlators/features/marker/utils/src/gsyncd.c @@ -19,6 +19,17 @@ #include <string.h> #include <sys/param.h> /* for PATH_MAX */ +/* NOTE (USE_LIBGLUSTERFS): + * ------------------------ + * When USE_LIBGLUSTERFS debugging sumbol is passed; perform + * glusterfs translator like initialization so that glusterfs + * globals, contexts are valid when glustefs api's are invoked. + * We unconditionally pass then while building gsyncd binary. + */ +#ifdef USE_LIBGLUSTERFS +#include "glusterfs.h" +#include "globals.h" +#endif #include "common-utils.h" #include "run.h" @@ -290,6 +301,19 @@ main (int argc, char **argv) char *b = NULL; char *sargv = NULL; +#ifdef USE_LIBGLUSTERFS + glusterfs_ctx_t *ctx = NULL; + + ctx = glusterfs_ctx_new (); + if (!ctx) + return ENOMEM; + + if (glusterfs_globals_init (ctx)) + return 1; + + THIS->ctx = ctx; +#endif + evas = getenv (_GLUSTERD_CALLED_); if (evas && strcmp (evas, "1") == 0) /* OK, we know glusterd called us, no need to look for further config |