From: Michael Jeanson Date: Wed, 15 Jun 2016 21:18:02 +0000 (-0400) Subject: Fix: snapshot del-output with name on musl X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=07f5023712313d73ab3feac62390a2d50457b7aa Fix: snapshot del-output with name on musl Some implementations of strtol(), like the one in musl, will return EINVAL in errno when no valid number was found in the string. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index d948226ae..00aa5b790 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -350,7 +350,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);