From: Martin Schwenke Date: Tue, 7 Jul 2026 12:25:20 +0000 (+1000) Subject: ctdb-common: Drop unused rundir support X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29dfd99de4f8c1aee65f50ba25fa9da5b3ef7cc6;p=thirdparty%2Fsamba.git ctdb-common: Drop unused rundir support It no longer makes sense because separate lockdir, piddir, socketdir support should be used. Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S --- diff --git a/ctdb/common/path.c b/ctdb/common/path.c index 9d23ddcd512..e4b05328eba 100644 --- a/ctdb/common/path.c +++ b/ctdb/common/path.c @@ -33,7 +33,6 @@ struct { const char* helperdir; char lockdir[PATH_MAX]; char piddir[PATH_MAX]; - char rundir[PATH_MAX]; char socketdir[PATH_MAX]; char vardir[PATH_MAX]; bool test_mode; @@ -43,7 +42,6 @@ struct { bool helperdir_set; bool lockdir_set; bool piddir_set; - bool rundir_set; bool socketdir_set; bool vardir_set; } ctdb_paths = { @@ -52,7 +50,6 @@ struct { .helperdir = CTDB_HELPER_BINDIR, .lockdir = CTDB_LOCKDIR, .piddir = CTDB_PIDDIR, - .rundir = CTDB_RUNDIR, .socketdir = CTDB_SOCKETDIR, .vardir = CTDB_VARDIR, }; @@ -210,22 +207,6 @@ const char *path_piddir(void) return ctdb_paths.piddir; } -const char *path_rundir(void) -{ - bool ok; - - if (! ctdb_paths.rundir_set) { - ok = path_construct(ctdb_paths.rundir, "run"); - if (!ok) { - D_ERR("Failed to construct RUNDIR\n"); - } else { - ctdb_paths.rundir_set = true; - } - } - - return ctdb_paths.rundir; -} - const char *path_socketdir(void) { bool ok; @@ -283,11 +264,6 @@ char *path_piddir_append(TALLOC_CTX *mem_ctx, const char *path) return talloc_asprintf(mem_ctx, "%s/%s", path_piddir(), path); } -char *path_rundir_append(TALLOC_CTX *mem_ctx, const char *path) -{ - return talloc_asprintf(mem_ctx, "%s/%s", path_rundir(), path); -} - char *path_socketdir_append(TALLOC_CTX *mem_ctx, const char *path) { return talloc_asprintf(mem_ctx, "%s/%s", path_socketdir(), path); diff --git a/ctdb/common/path.h b/ctdb/common/path.h index 068e11b96d0..dd1e83760e5 100644 --- a/ctdb/common/path.h +++ b/ctdb/common/path.h @@ -27,7 +27,6 @@ const char *path_etcdir(void); const char *path_helperdir(void); const char *path_lockdir(void); const char *path_piddir(void); -const char *path_rundir(void); const char *path_socketdir(void); const char *path_vardir(void); @@ -36,7 +35,6 @@ char *path_etcdir_append(TALLOC_CTX *mem_ctx, const char *path); char *path_helperdir_append(TALLOC_CTX *mem_ctx, const char *path); char *path_lockdir_append(TALLOC_CTX *mem_ctx, const char *path); char *path_piddir_append(TALLOC_CTX *mem_ctx, const char *path); -char *path_rundir_append(TALLOC_CTX *mem_ctx, const char *path); char *path_socketdir_append(TALLOC_CTX *mem_ctx, const char *path); char *path_vardir_append(TALLOC_CTX *mem_ctx, const char *path); diff --git a/ctdb/common/path_tool.c b/ctdb/common/path_tool.c index e0738858638..93bd662bf37 100644 --- a/ctdb/common/path_tool.c +++ b/ctdb/common/path_tool.c @@ -238,34 +238,6 @@ static int path_tool_piddir_append(TALLOC_CTX *mem_ctx, return ret; } -static int path_tool_rundir(TALLOC_CTX *mem_ctx, - int argc, - const char **argv, - void *private_data) -{ - int ret = path_tool_generic(mem_ctx, - argc, - argv, - private_data, - "rundir", - path_rundir); - return ret; -} - -static int path_tool_rundir_append(TALLOC_CTX *mem_ctx, - int argc, - const char **argv, - void *private_data) -{ - int ret = path_tool_append_generic(mem_ctx, - argc, - argv, - private_data, - "rundir append", - path_rundir_append); - return ret; -} - static int path_tool_socketdir(TALLOC_CTX *mem_ctx, int argc, const char **argv, @@ -389,18 +361,6 @@ struct cmdline_command path_commands[] = { .msg_help = "Get path of CTDB PIDDIR", .msg_args = NULL, }, - { - .name = "rundir append", - .fn = path_tool_rundir_append, - .msg_help = "Get path relative to CTDB RUNDIR", - .msg_args = "", - }, - { - .name = "rundir", - .fn = path_tool_rundir, - .msg_help = "Get path of CTDB RUNDIR", - .msg_args = NULL, - }, { .name = "socketdir append", .fn = path_tool_socketdir_append, diff --git a/ctdb/tests/UNIT/cunit/path_tests_001.sh b/ctdb/tests/UNIT/cunit/path_tests_001.sh index 513f0d47373..541304e022e 100755 --- a/ctdb/tests/UNIT/cunit/path_tests_001.sh +++ b/ctdb/tests/UNIT/cunit/path_tests_001.sh @@ -39,11 +39,6 @@ $CTDB_BASE/run EOF unit_test ctdb-path piddir -ok <