summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-03-07 16:15:01 +1100
committerAmitay Isaacs <amitay@samba.org>2015-05-10 03:22:13 +0200
commita2c64a4810df6d70ec65a1fc773a5175a298788d (patch)
tree8e7571213ccc5b2f85274a4ce80825af6d96fbb4 /ctdb
parentc927ec928cce1ee4cf9ffcf4aa3d6c8ef6ad4144 (diff)
downloadsamba-a2c64a4810df6d70ec65a1fc773a5175a298788d.tar.gz
ctdb-common: Reimplement external tracing using ctdb_set_helper()
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/ctdb_util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index 8e2e430da71..5d63c272926 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -134,14 +134,16 @@ bool ctdb_set_helper(const char *type, char *helper, size_t size,
void ctdb_external_trace(void)
{
int ret;
- const char * t = getenv("CTDB_EXTERNAL_TRACE");
+ static char external_trace[PATH_MAX+1] = "";
char * cmd;
- if (t == NULL) {
+ if (!ctdb_set_helper("external trace handler",
+ external_trace, sizeof(external_trace),
+ "CTDB_EXTERNAL_TRACE", NULL, NULL)) {
return;
}
- cmd = talloc_asprintf(NULL, "%s %lu", t, (unsigned long) getpid());
+ cmd = talloc_asprintf(NULL, "%s %lu", external_trace, (unsigned long) getpid());
DEBUG(DEBUG_WARNING,("begin external trace: %s\n", cmd));
ret = system(cmd);
if (ret == -1) {