Just leak the memory allocated by path_socket(). This is only used in
short-lived test programs, so it isn't worth the hassle of plumbing a
talloc context through several layers to get here.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
#include <popt.h>
#include <talloc.h>
#include "lib/util/debug.h"
#include "common/logging.h"
#include <popt.h>
#include <talloc.h>
#include "lib/util/debug.h"
#include "common/logging.h"
+#include "common/path.h"
#include "tests/src/test_options.h"
#include "tests/src/test_options.h"
static void set_defaults_basic(struct test_options *opts)
{
static void set_defaults_basic(struct test_options *opts)
{
- const char *ctdb_socket;
-
/* Set default options */
/* Set default options */
- opts->socket = CTDB_SOCKET;
+ opts->socket = path_socket(NULL, "ctdbd"); /* leaked */
+ assert(opts->socket != NULL);
+
opts->timelimit = 10;
opts->num_nodes = 1;
opts->debugstr = "ERR";
opts->interactive = 0;
opts->timelimit = 10;
opts->num_nodes = 1;
opts->debugstr = "ERR";
opts->interactive = 0;
-
- ctdb_socket = getenv("CTDB_SOCKET");
- if (ctdb_socket != NULL) {
- opts->socket = ctdb_socket;
- }
}
static void set_defaults_database(struct test_options *opts)
}
static void set_defaults_database(struct test_options *opts)