}
/*
- * This thread manage application communication.
+ * This thread receives application command sockets (FDs) on the
+ * apps_cmd_pipe and waits (polls) on them until they are closed
+ * or an error occurs.
+ *
+ * At that point, it flushes the data (tracing and metadata) associated
+ * with this application and tears down ust app sessions and other
+ * associated data structures through ust_app_unregister().
+ *
+ * Note that this thread never sends commands to the applications
+ * through the command sockets; it merely listens for hang-ups
+ * and errors on those sockets and cleans-up as they occur.
*/
static void *thread_manage_apps(void *data)
{
break;
case LTTNG_CONSUMER64_UST:
{
- char *tmpnew = NULL;
-
if (config.consumerd64_lib_dir.value) {
char *tmp;
size_t tmplen;
+ char *tmpnew;
tmp = lttng_secure_getenv("LD_LIBRARY_PATH");
if (!tmp) {
strcat(tmpnew, tmp);
}
ret = setenv("LD_LIBRARY_PATH", tmpnew, 1);
+ free(tmpnew);
if (ret) {
ret = -errno;
- free(tmpnew);
goto error;
}
}
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
- free(tmpnew);
break;
}
case LTTNG_CONSUMER32_UST:
{
- char *tmpnew = NULL;
-
if (config.consumerd32_lib_dir.value) {
char *tmp;
size_t tmplen;
+ char *tmpnew;
tmp = lttng_secure_getenv("LD_LIBRARY_PATH");
if (!tmp) {
strcat(tmpnew, tmp);
}
ret = setenv("LD_LIBRARY_PATH", tmpnew, 1);
+ free(tmpnew);
if (ret) {
ret = -errno;
- free(tmpnew);
goto error;
}
}
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
"--group", config.tracing_group_name.value,
NULL);
- free(tmpnew);
break;
}
default: