From 32c2ec8fa25ad21b9739a288f4a11db2bac1dc6f Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 18 Sep 2018 16:19:40 +1000 Subject: [PATCH] ctdb-common: Allow path_socket() to use $CTDB_SOCKET Use of CTDB_SOCKET is being generally removed. However, this override is being added to allow test code outside of ctdb/ to be able to specify the socket, if desired. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/common/path.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ctdb/common/path.c b/ctdb/common/path.c index 165664650ed..69e606b4ede 100644 --- a/ctdb/common/path.c +++ b/ctdb/common/path.c @@ -188,6 +188,14 @@ char *path_config(TALLOC_CTX *mem_ctx) char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon) { + if (strcmp(daemon, "ctdbd") == 0) { + const char *t = getenv("CTDB_SOCKET"); + + if (t != NULL) { + return talloc_strdup(mem_ctx, t); + } + } + return talloc_asprintf(mem_ctx, "%s/%s.socket", path_rundir(),