From: Amitay Isaacs Date: Mon, 23 Jun 2014 08:03:17 +0000 (+1000) Subject: ctdb-build: Use CTDB_ETCDIR instead of ETCDIR/ctdb X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=4f6d668cfa7c34c10cf180f3cef84b151eba5ea1 ctdb-build: Use CTDB_ETCDIR instead of ETCDIR/ctdb This avoids hardcoding path components in source. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index 5cd04971f075..9cbdc2632e0b 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -240,7 +240,7 @@ int main(int argc, const char *argv[]) ctdb->pnn = -1; /* Default value for CTDB_BASE - don't override */ - setenv("CTDB_BASE", ETCDIR "/ctdb", 0); + setenv("CTDB_BASE", CTDB_ETCDIR, 0); /* tell ctdb what nodes are available */ if (options.nlist != NULL) { diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index a108b785ede6..604b8de44b57 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -440,7 +440,7 @@ static void debug_hung_script_done(struct tevent_context *ev, struct tevent_fd * static void ctdb_run_debug_hung_script(struct ctdb_context *ctdb, struct debug_hung_script_state *state) { pid_t pid; - const char * debug_hung_script = ETCDIR "/ctdb/debug-hung-script.sh"; + const char * debug_hung_script = CTDB_ETCDIR "/debug-hung-script.sh"; int fd[2]; struct tevent_timer *ttimer; struct tevent_fd *tfd; diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 4704726de7df..aa0e4e3e4ea4 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -6536,7 +6536,7 @@ int main(int argc, const char *argv[]) control = extra_argv[0]; /* Default value for CTDB_BASE - don't override */ - setenv("CTDB_BASE", ETCDIR "/ctdb", 0); + setenv("CTDB_BASE", CTDB_ETCDIR, 0); ev = event_context_init(NULL); if (!ev) { diff --git a/ctdb/wscript b/ctdb/wscript index 5808ae245940..1dcc11cbc2ba 100755 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -130,14 +130,16 @@ def configure(conf): conf.env.CTDB_SOCKPATH = os.path.join(conf.env.CTDB_RUNDIR, 'ctdbd.socket') - conf.ADD_CFLAGS('''-DBINDIR=\"%s\" -DETCDIR=\"%s\" - -DLOGDIR=\"%s\" -DSOCKPATH=\"%s\" + conf.ADD_CFLAGS('''-DBINDIR=\"%s\" + -DLOGDIR=\"%s\" + -DSOCKPATH=\"%s\" + -DCTDB_ETCDIR=\"%s\" -DCTDB_VARDIR=\"%s\" -DCTDB_RUNDIR=\"%s\"''' % ( conf.env.CTDB_BINDIR, - conf.env.CTDB_ETCDIR, conf.env.CTDB_LOGDIR, conf.env.CTDB_SOCKPATH, + conf.env.CTDB_ETCDIR, conf.env.CTDB_VARDIR, conf.env.CTDB_RUNDIR))