lttng_strerror(): accept positive and negative codes
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.cpp
index 3622987183c5db8c4bdf8e0f48b70b7bd63b5366..63841df403f249d5aeb681ce81a0ec671b7d4242 100644 (file)
@@ -47,7 +47,7 @@
 
 #include "lttng-ctl-helper.h"
 #include <common/filter/filter-ast.h>
-#include <common/filter/filter-parser.h>
+#include <common/filter/filter-parser.hpp>
 #include <common/filter/memstream.h>
 
 #define COPY_DOMAIN_PACKED(dst, src)                           \
@@ -1769,10 +1769,14 @@ int lttng_list_syscalls(struct lttng_event **events)
 
 /*
  * Returns a human readable string describing
- * the error code (a negative value).
+ * the error code (positive or negative value).
  */
 const char *lttng_strerror(int code)
 {
+       if (code > 0) {
+               code = -code;
+       }
+
        return error_get_str(code);
 }
 
This page took 0.028367 seconds and 4 git commands to generate.