X-Git-Url: http://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=libust%2Ftracectl.c;h=1b684445e63f1a2efa38bd59f0678f018adb6a9a;hp=03220373c92dee9c7eea7ee259d231de8924b809;hb=b2fb2f91912b59447459eecc4b41baf8154be1bf;hpb=d159ac37826eaebf4c1d87b8db0c5e5a8ccc0b00 diff --git a/libust/tracectl.c b/libust/tracectl.c index 0322037..1b68444 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -994,6 +994,25 @@ int process_client_cmd(char *recvbuf, struct ustcomm_source *src) free(reply); } + else if(nth_token_is(recvbuf, "get_sock_path", 0) == 1) { + char *reply = getenv("UST_DAEMON_SOCKET"); + if(!reply) { + asprintf(&reply, "%s/%s", SOCK_DIR, "ustd"); + result = ustcomm_send_reply(&ustcomm_app.server, reply, src); + free(reply); + } + else { + result = ustcomm_send_reply(&ustcomm_app.server, reply, src); + } + if(result) + ERR("ustcomm_send_reply failed"); + } + else if(nth_token_is(recvbuf, "set_sock_path", 0) == 1) { + char *sock_path = nth_token(recvbuf, 1); + result = setenv("UST_DAEMON_SOCKET", sock_path, 1); + if(result) + ERR("cannot set UST_DAEMON_SOCKET environment variable"); + } else { ERR("unable to parse message: %s", recvbuf); }