summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-07-06 11:48:28 +1000
committerAmitay Isaacs <amitay@samba.org>2015-07-14 09:57:17 +0200
commitb71d18d2dc090e99d67c6bd8552380b44f8db810 (patch)
tree00adbd5c27522cd9ab14021b8079cc2e5bd7ef28 /ctdb
parentf951ff13838e796cd6661d800daf460247cac60b (diff)
downloadsamba-b71d18d2dc090e99d67c6bd8552380b44f8db810.tar.gz
ctdb-tools: Avoiding printing "(null)" on "ctdb eventscript" error
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tools/ctdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 57c7052b644..4734b26caff 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -5356,7 +5356,12 @@ static int control_eventscript(struct ctdb_context *ctdb, int argc, const char *
ret = ctdb_control(ctdb, options.pnn, 0, CTDB_CONTROL_RUN_EVENTSCRIPTS,
0, data, tmp_ctx, NULL, &res, NULL, &errmsg);
if (ret != 0 || res != 0) {
- DEBUG(DEBUG_ERR,("Failed to run eventscripts - %s\n", errmsg));
+ if (errmsg != NULL) {
+ DEBUG(DEBUG_ERR,
+ ("Failed to run eventscripts - %s\n", errmsg));
+ } else {
+ DEBUG(DEBUG_ERR, ("Failed to run eventscripts\n"));
+ }
talloc_free(tmp_ctx);
return -1;
}