Doc: via -> using
[lttng-tools.git] / src / bin / lttng / commands / create.c
index f020fff638957548cf90c7a2aed118f80f067abb..662f63072e4f01d49fe0ac294fe48034132c844f 100644 (file)
@@ -228,6 +228,7 @@ error_create:
 static int validate_command_options(void)
 {
        int ret = CMD_SUCCESS;
+
        if (opt_snapshot && opt_live_timer) {
                ERR("Snapshot and live modes are mutually exclusive.");
                ret = CMD_ERROR;
@@ -235,7 +236,7 @@ static int validate_command_options(void)
        }
 
        if ((!opt_ctrl_url && opt_data_url) || (opt_ctrl_url && !opt_data_url)) {
-               ERR("You need both control and data URL.");
+               ERR("Control and data URLs must both be set.");
                ret = CMD_ERROR;
                goto error;
        }
@@ -245,7 +246,7 @@ error:
 }
 
 /*
- * Create a session via direct calls to liblttng-ctl.
+ * Create a session using direct calls to liblttng-ctl.
  *
  * Return CMD_SUCCESS on success, negative value on internal lttng errors and positive
  * value on command errors.
@@ -509,7 +510,7 @@ static int create_session(void)
                                strlen(DEFAULT_SESSION_NAME) + 1) == 0) ||
                        (strncmp(opt_session_name, DEFAULT_SESSION_NAME,
                                strlen(DEFAULT_SESSION_NAME)) == 0 &&
-                        strlen(opt_session_name) == strlen(DEFAULT_SESSION_NAME))) {
+                       strlen(opt_session_name) == strlen(DEFAULT_SESSION_NAME))) {
                        ERR("%s is a reserved keyword for default session(s)",
                                        DEFAULT_SESSION_NAME);
 
@@ -538,10 +539,9 @@ static int create_session(void)
                }
        } else {
                /* Generate a name */
-               /* TODO: use asprint */
                ret = asprintf(&base_session_name, DEFAULT_SESSION_NAME "-%s", datetime);
                if (ret < 0) {
-                       PERROR("Asprintf generated session name");
+                       PERROR("Asprintf session name");
                        goto error;
                }
                session_name_date = strdup(base_session_name);
@@ -724,15 +724,14 @@ static int create_session(void)
        ret = CMD_SUCCESS;
 
 error:
-
        /* Session temp stuff */
        free(session_name_date);
-
        free(uris);
 
        if (ret < 0) {
                ERR("%s", lttng_strerror(ret));
        }
+
        free(base_session_name);
        free(base_url);
        free(base_ctrl_url);
This page took 0.026576 seconds and 5 git commands to generate.