1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

ctdb-common: Reimplement external tracing using ctdb_set_helper()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2015-03-07 16:15:01 +11:00 committed by Amitay Isaacs
parent c927ec928c
commit a2c64a4810

View File

@ -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) {