From 07f5023712313d73ab3feac62390a2d50457b7aa Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 15 Jun 2016 17:18:02 -0400 Subject: [PATCH] Fix: snapshot del-output with name on musl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/commands/snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.34.1