From: Martin Schwenke Date: Thu, 10 May 2018 06:46:18 +0000 (+1000) Subject: ctdb-tools: Use path_socket() in ctdb tool X-Git-Tag: tdb-1.3.17~912 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc3aedd307037e20f3d2e452ebf25927cea29708;p=thirdparty%2Fsamba.git ctdb-tools: Use path_socket() in ctdb tool Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 0652a205dbd..8fa1ce63203 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -37,6 +37,7 @@ #include "common/db_hash.h" #include "common/logging.h" +#include "common/path.h" #include "protocol/protocol.h" #include "protocol/protocol_api.h" #include "protocol/protocol_util.h" @@ -6119,9 +6120,10 @@ static int process_command(const struct ctdb_cmd *cmd, int argc, goto fail; } - ctdb_socket = getenv("CTDB_SOCKET"); + ctdb_socket = path_socket(ctdb, "ctdbd"); if (ctdb_socket == NULL) { - ctdb_socket = CTDB_SOCKET; + fprintf(stderr, "Memory allocation error\n"); + goto fail; } ret = ctdb_client_init(ctdb, ctdb->ev, ctdb_socket, &ctdb->client);