ctdbd: Don't check CTDB_BASE before setting it, just don't override
authorMartin Schwenke <martin@meltin.net>
Tue, 15 Oct 2013 03:02:31 +0000 (14:02 +1100)
committerMartin Schwenke <martin@meltin.net>
Tue, 22 Oct 2013 04:37:54 +0000 (15:37 +1100)
That's what the 3rd argument to setenv(3) is for...  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdbd.c

index 2857104bd30851508802b66534a994c79d5a7824..28fe87986404db5240a333bf6f2e018e74de85bc 100644 (file)
@@ -323,11 +323,8 @@ int main(int argc, const char *argv[])
                ctdb->max_persistent_check_errors = (uint64_t)options.max_persistent_check_errors;
        }
 
-       if (getenv("CTDB_BASE") == NULL) {
-               /* setup a environment variable for the event scripts to use
-                  to find the installation directory */
-               setenv("CTDB_BASE", ETCDIR "/ctdb", 1);
-       }
+       /* Default value for CTDB_BASE - don't override */
+       setenv("CTDB_BASE", ETCDIR "/ctdb", 0);
 
        /* start the protocol running (as a child) */
        return ctdb_start_daemon(ctdb, interactive?false:true, options.use_syslog, options.public_address_list);