X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttngctl%2Fliblttngctl.c;h=adff646e175b50d1847c8ee6d4e6f9a5b68e2276;hp=76bdf5ffde2ff29b43940f3226f51fc8d5a10329;hb=7442b2ba0c15bf9c950b96a19e948243c2b57683;hpb=b42dc92c1003cb5a1912cd86c59fbaa3544a3e10 diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index 76bdf5ffd..adff646e1 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -111,6 +111,11 @@ static int ask_sessiond(enum lttcomm_command_type lct, void **buf) size_t size; void *data = NULL; + ret = lttng_connect_sessiond(); + if (ret < 0) { + goto end; + } + lsm.cmd_type = lct; /* Send command to session daemon */ @@ -148,7 +153,7 @@ static int ask_sessiond(enum lttcomm_command_type lct, void **buf) ret = size; end: - /* Reset lsm data struct */ + lttng_disconnect_sessiond(); memset(&lsm, 0, sizeof(lsm)); return ret; }