X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fsnapshot.c;h=d8a6b81486939fdb945ca91b96bc19a6be4c6ce3;hp=c8a7ba0588f4d47fcc5ed5de98101caee937ace5;hb=4fc83d948cea6b10484e65f004a6c167e71ac440;hpb=779f455d7b2074388346c75ec842112819fec8b8 diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index c8a7ba058..d8a6b8148 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -48,6 +48,12 @@ static int cmd_record(int argc, const char **argv); static const char *indent4 = " "; +#ifdef LTTNG_EMBED_HELP +static const char help_msg[] = +#include +; +#endif + enum { OPT_HELP = 1, OPT_LIST_OPTIONS, @@ -350,7 +356,7 @@ static int cmd_del_output(int argc, const char **argv) errno = 0; id = strtol(argv[1], &name, 10); - if (id == 0 && errno == 0) { + if (id == 0 && (errno == 0 || errno == EINVAL)) { ret = del_output(UINT32_MAX, name); } else if (errno == 0 && *name == '\0') { ret = del_output(id, NULL); @@ -579,9 +585,6 @@ int cmd_snapshot(int argc, const char **argv) command_ret = handle_command(poptGetArgs(pc)); if (command_ret) { switch (-command_ret) { - case LTTNG_ERR_EPERM: - ERR("The session needs to be set in no output mode (--no-output)"); - break; case LTTNG_ERR_SNAPSHOT_NODATA: WARN("%s", lttng_strerror(command_ret)); @@ -636,7 +639,7 @@ end: free(session_name); } - /* Overwrite ret if an error occured during handle_command */ + /* Overwrite ret if an error occurred during handle_command */ ret = command_ret ? command_ret : ret; poptFreeContext(pc); return ret;