X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fsnapshot.c;h=c37e09a7dbed02eb1c192481c0955544808e4d7b;hb=81663f073dbfb4b61c06a0ceb8ca33c4fc41b1c5;hp=904ebae15c8450b6ff1d887fdce3a883d5c648f4;hpb=d295668767ac8234e83984e1812d342d03293d88;p=lttng-tools.git diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index 904ebae15..c37e09a7d 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -1,22 +1,11 @@ /* - * Copyright (C) 2013 - David Goulet + * Copyright (C) 2013 David Goulet * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE -#include #include #include #include @@ -25,11 +14,10 @@ #include #include #include -#include #include #include -#include +#include #include "../command.h" @@ -91,7 +79,7 @@ static int count_arguments(const char **argv) { int i = 0; - assert(argv); + LTTNG_ASSERT(argv); while (argv[i] != NULL) { i++; @@ -483,7 +471,7 @@ static enum cmd_error_code handle_command(const char **argv) argc = count_arguments(argv); /* popt should have passed NULL if no arguments are present. */ - assert(argc > 0); + LTTNG_ASSERT(argc > 0); cmd = &actions[i]; while (cmd->func != NULL) { @@ -634,10 +622,11 @@ int cmd_snapshot(int argc, const char **argv) case OPT_MAX_SIZE: { uint64_t val; - const char *opt = poptGetOptArg(pc); + const char *max_size_arg = poptGetOptArg(pc); - if (utils_parse_size_suffix((char *) opt, &val) < 0) { - ERR("Unable to handle max-size value %s", opt); + if (utils_parse_size_suffix((char *) max_size_arg, &val) < 0) { + ERR("Unable to handle max-size value %s", + max_size_arg); cmd_ret = CMD_ERROR; goto end; }