ctdb-build: Use CTDB_ETCDIR instead of ETCDIR/ctdb
authorAmitay Isaacs <amitay@gmail.com>
Mon, 23 Jun 2014 08:03:17 +0000 (18:03 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 24 Jun 2014 05:23:13 +0000 (07:23 +0200)
This avoids hardcoding path components in source.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdbd.c
ctdb/server/eventscript.c
ctdb/tools/ctdb.c
ctdb/wscript

index 5cd04971f075af33c55a869cd9fbe1945b8aead2..9cbdc2632e0bf02bb2c1dcc8ba2f32870a2d8372 100644 (file)
@@ -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) {
index a108b785ede6c31f0156331881f27e0f2c8a8a78..604b8de44b575a2ad20da53eee6febac359a55e4 100644 (file)
@@ -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;
index 4704726de7df52410690f5bb7837ed9bc8d48f4e..aa0e4e3e4ea45ecc07ffb8ce4ef6f4e46dda0015 100644 (file)
@@ -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) {
index 5808ae24594034cd4d8a7715212b9c81ff19c3db..1dcc11cbc2ba214b06407d6e32098c8e696d61fb 100755 (executable)
@@ -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))