Make the launch of the application registration thread blocking
[lttng-tools.git] / src / bin / lttng-sessiond / sessiond-config.c
index 0b540865667ec526f51001687b254a9d67c6e3a3..72845d0de3923786ff75f2012295c1e79f0219d9 100644 (file)
@@ -269,13 +269,16 @@ int sessiond_config_init(struct sessiond_config *config)
        } else {
                ret = config_set_paths_non_root(config);
        }
+       if (ret < 0) {
+               goto error;
+       }
 
        /* 32 bits consumerd path setup */
        ret = asprintf(&str, DEFAULT_USTCONSUMERD32_PATH,
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_path, str);
        str = NULL;
@@ -284,7 +287,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_err_unix_sock_path, str);
        str = NULL;
@@ -293,7 +296,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_cmd_unix_sock_path, str);
        str = NULL;
@@ -303,7 +306,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_path, str);
        str = NULL;
@@ -312,7 +315,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_err_unix_sock_path, str);
        str = NULL;
@@ -321,7 +324,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_cmd_unix_sock_path, str);
        str = NULL;
@@ -331,7 +334,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_path, str);
        str = NULL;
@@ -340,7 +343,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_err_unix_sock_path, str);
        str = NULL;
@@ -349,7 +352,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_cmd_unix_sock_path, str);
        str = NULL;
@@ -358,7 +361,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_PIDFILE);
        if (ret < 0) {
                ERR("Failed to set PID file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->pid_file_path, str);
        str = NULL;
@@ -367,7 +370,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_LOCKFILE);
        if (ret < 0) {
                ERR("Failed to set lock file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->lock_file_path, str);
        str = NULL;
@@ -376,7 +379,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_AGENTPORT_FILE);
        if (ret < 0) {
                ERR("Failed to set agent port file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->agent_port_file_path, str);
        str = NULL;
@@ -400,7 +403,9 @@ int sessiond_config_init(struct sessiond_config *config)
 #error "Unknown bitness"
 #endif
        ret = 0;
-end:
+       return ret;
+error:
+       sessiond_config_fini(config);
        return ret;
 }
 
This page took 0.026925 seconds and 4 git commands to generate.