From f8c19b4c6af34b96747881bcb85cddb87484f08e Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Tue, 30 Oct 2012 15:54:05 +0100 Subject: geo-rep / gsyncd,glusterd: do not hardcode socket path ... in gsyncd python code. Indeed, use the configuration mechanism to set it suitably from glusterd. Change-Id: I9fe2088b14d28588d1e64fe892740cc5755b8365 BUG: 868877 Signed-off-by: Csaba Henk Reviewed-on: http://review.gluster.org/4143 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6c2870238..5395e0a9c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -70,7 +70,6 @@ #define CEILING_POS(X) (((X)-(int)(X)) > 0 ? (int)((X)+1) : (int)(X)) -char *glusterd_sock_dir = "/var/run"; static glusterd_lock_t lock; static void @@ -1091,7 +1090,7 @@ glusterd_set_socket_filepath (char *sock_filepath, char *sockpath, size_t len) char md5_sum[MD5_DIGEST_LENGTH*2+1] = {0,}; md5_wrapper ((unsigned char *) sock_filepath, strlen(sock_filepath), md5_sum); - snprintf (sockpath, len, "%s/%s.socket", glusterd_sock_dir, md5_sum); + snprintf (sockpath, len, "%s/%s.socket", GLUSTERD_SOCK_DIR, md5_sum); } void @@ -1106,7 +1105,7 @@ glusterd_set_brick_socket_filepath (glusterd_volinfo_t *volinfo, glusterd_conf_t *priv = NULL; int expected_file_len = 0; - expected_file_len = strlen (glusterd_sock_dir) + strlen ("/") + + expected_file_len = strlen (GLUSTERD_SOCK_DIR) + strlen ("/") + MD5_DIGEST_LENGTH*2 + strlen (".socket") + 1; GF_ASSERT (len >= expected_file_len); this = THIS; -- cgit