- /* Set global SHM for ust */
- if (strlen(wait_shm_path) == 0) {
- ret = snprintf(wait_shm_path, PATH_MAX,
- DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH);
- if (ret < 0) {
- retval = -1;
- goto exit_init_data;
- }
- }
-
- if (strlen(health_unix_sock_path) == 0) {
- ret = snprintf(health_unix_sock_path,
- sizeof(health_unix_sock_path),
- DEFAULT_GLOBAL_HEALTH_UNIX_SOCK);
- if (ret < 0) {
- retval = -1;
- goto exit_init_data;
- }
- }
-
- /* Setup kernel consumerd path */
- ret = snprintf(kconsumer_data.err_unix_sock_path, PATH_MAX,
- DEFAULT_KCONSUMERD_ERR_SOCK_PATH, rundir);
- if (ret < 0) {
- retval = -1;
- goto exit_init_data;
- }
- ret = snprintf(kconsumer_data.cmd_unix_sock_path, PATH_MAX,
- DEFAULT_KCONSUMERD_CMD_SOCK_PATH, rundir);
- if (ret < 0) {
- retval = -1;
- goto exit_init_data;
- }
-
- DBG2("Kernel consumer err path: %s",
- kconsumer_data.err_unix_sock_path);
- DBG2("Kernel consumer cmd path: %s",
- kconsumer_data.cmd_unix_sock_path);
- } else {
- home_path = utils_get_home_dir();
- if (home_path == NULL) {
- /* TODO: Add --socket PATH option */
- ERR("Can't get HOME directory for sockets creation.");
- retval = -1;
- goto exit_init_data;
- }
-
- /*
- * Create rundir from home path. This will create something like
- * $HOME/.lttng
- */
- ret = asprintf(&rundir, DEFAULT_LTTNG_HOME_RUNDIR, home_path);
- if (ret < 0) {