X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fsnapshot.c;h=be28511b33f65c5a5cc39710b7c755432aacb6a7;hp=0c15dbb70fa5f6b8f2adb8f314d9db4b4b773432;hb=e1986656f8267fb64f5ac67c0d464d157b8a050b;hpb=5c786dedd0156b93984f89ba47ec841277ed7dae diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index 0c15dbb70..be28511b3 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -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); @@ -422,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)) {