From: Martin Schwenke Date: Fri, 15 Aug 2025 04:59:49 +0000 (+1000) Subject: ctdb-common: Factor out checking of CTDB_TEST_MODE X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c12a36eb5b44fb08d0461e6fa77fcdb4a128433;p=thirdparty%2Fsamba.git ctdb-common: Factor out checking of CTDB_TEST_MODE For use elsewhere. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15921 Signed-off-by: Martin Schwenke --- diff --git a/ctdb/common/path.c b/ctdb/common/path.c index ea3b08f4b2e..0673bace531 100644 --- a/ctdb/common/path.c +++ b/ctdb/common/path.c @@ -45,16 +45,24 @@ struct { .vardir = CTDB_VARDIR, }; -static void path_set_basedir(void) +static void path_set_test_mode(void) { - const char *t; + const char *t = NULL; t = getenv("CTDB_TEST_MODE"); if (t == NULL) { - goto done; + return; } ctdb_paths.test_mode = true; +} + +static void path_set_basedir(void) +{ + path_set_test_mode(); + if (!ctdb_paths.test_mode) { + goto done; + } ctdb_paths.basedir = getenv("CTDB_BASE"); if (ctdb_paths.basedir == NULL) {