Fix: support temporary snapshot max size and name
[lttng-tools.git] / src / bin / lttng / commands / snapshot.c
index 2a223d44509721fedbdbcbe6bc2f3c12da72828a..be28511b33f65c5a5cc39710b7c755432aacb6a7 100644 (file)
@@ -323,12 +323,10 @@ static int record(const char *url)
        int ret;
        struct lttng_snapshot_output *output = NULL;
 
-       if (url || (opt_ctrl_url && opt_data_url)) {
-               output = create_output_from_args(url);
-               if (!output) {
-                       ret = CMD_FATAL;
-                       goto error;
-               }
+       output = create_output_from_args(url);
+       if (!output) {
+               ret = CMD_FATAL;
+               goto error;
        }
 
        ret = lttng_snapshot_record(current_session_name, output, 0);
@@ -343,8 +341,6 @@ static int record(const char *url)
        } else if (opt_ctrl_url) {
                MSG("Snapshot written to ctrl: %s, data: %s", opt_ctrl_url,
                                opt_data_url);
-       } else {
-               MSG("Snapshot written in session directory.");
        }
 
 error:
@@ -424,6 +420,8 @@ int cmd_snapshot(int argc, const char **argv)
                        char *endptr;
                        const char *opt = poptGetOptArg(pc);
 
+                       /* Documented by the man page of strtoll(3). */
+                       errno = 0;
                        val = strtoll(opt, &endptr, 10);
                        if ((errno == ERANGE && (val == LLONG_MAX || val == LONG_MIN))
                                        || (errno != 0 && val == 0)) {
This page took 0.026028 seconds and 5 git commands to generate.