From 00d4125a5cb7102efeb23873cbaf155a71faa9dd Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 31 Mar 2015 20:13:59 +0530 Subject: libgfchangelog: Use correct 'this' pointer on new thread creation When libgfchangelog is linked with non xlator application, it should point to 'master' xlator which is initiated separately. When ever a new thread is created, 'THIS' points to the global xlator. 'THIS' should point to corresponding xlator even then. This patch adjusts the pointer accordingly. Change-Id: I2a199bb3c73146a0329540aedcbae697a00f6f0a BUG: 1207643 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/10074 Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- xlators/features/changelog/lib/src/gf-changelog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/features/changelog/lib/src/gf-changelog.c') diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index 103a7b01eb0..f2a5135e12a 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -589,7 +589,10 @@ gf_changelog_register (char *brick_path, char *scratch_dir, { struct gf_brick_spec brick = {0,}; - THIS = master; + if (master) + THIS = master; + else + return -1; brick.brick_path = brick_path; brick.filter = CHANGELOG_OP_TYPE_JOURNAL; -- cgit