Uses of CTDB_BASE in the subsequent code are now handled by the path
module, so there is no point getting the value of CTDB_BASE. Instead,
check that the attempt to set it worked, noting that:
[...] if overwrite is zero, then the value of name is not
changed (and setenv() returns a success status).
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
const char **extra_argv;
poptContext pc;
struct tevent_context *ev;
- const char *ctdb_base;
struct conf_context *conf;
const char *logging_location;
const char *test_mode;
}
/* Default value for CTDB_BASE - don't override */
- setenv("CTDB_BASE", CTDB_ETCDIR, 0);
- ctdb_base = getenv("CTDB_BASE");
- if (ctdb_base == NULL) {
- D_ERR("CTDB_BASE not set\n");
+ ret = setenv("CTDB_BASE", CTDB_ETCDIR, 0);
+ if (ret != 0) {
+ D_ERR("Unable to set CTDB_BASE (errno=%d)\n", errno);
exit(1);
}