0001-Fix-snapshot-del-output-with-name-on-musl.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. From: mjeanson@efficios.com Michael Jeanson
  2. Date: Wed, 15 Jun 2016 17:18:02 -0400
  3. Subject: [lttng-dev] [PATCH] Fix: snapshot del-output with name on musl
  4. Some implementations of strtol() like the one in musl will
  5. return EINVAL in perror when no valid number was found in
  6. the string.
  7. Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
  8. [Philippe: grabbed from the mailing list:
  9. https://lists.lttng.org/pipermail/lttng-dev/2016-June/026192.html
  10. and adapted to 2.8.2.]
  11. Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
  12. ---
  13. src/bin/lttng/commands/snapshot.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c
  16. index d948226..00aa5b7 100644
  17. --- a/src/bin/lttng/commands/snapshot.c
  18. +++ b/src/bin/lttng/commands/snapshot.c
  19. @@ -447,7 +447,7 @@ static int cmd_del_output(int argc, const char **argv)
  20. errno = 0;
  21. id = strtol(argv[1], &name, 10);
  22. - if (id == 0 && errno == 0) {
  23. + if (id == 0 && (errno == 0 || errno == EINVAL)) {
  24. if (lttng_opt_mi) {
  25. ret = mi_del_output(UINT32_MAX, name);
  26. } else {
  27. --
  28. 2.7.4