Missing negative sign to interpret error code
[lttng-tools.git] / include / lttngerr.h
index 1feb6cc4ded1ba9ad9e7fb7a04db46cb43790449..062908098f0f757543deb904de9c482ba3cbecdb 100644 (file)
@@ -3,8 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation; only version 2
+ * of the License.
  * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <errno.h>
 #include <stdio.h>
 
+/* Stringify the expansion of a define */
+#define XSTR(d) STR(d)
+#define STR(s) #s
+
 extern int opt_quiet;
 extern int opt_verbose;
 
@@ -54,6 +58,6 @@ enum __lttng_print_type {
 #define ERR(fmt, args...) __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args)
 #define WARN(fmt, args...) __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args)
 #define BUG(fmt, args...) __lttng_print(PRINT_BUG, "BUG: " fmt "\n", ## args)
-#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG: " fmt "\n", ## args)
+#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG: " fmt " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
 
 #endif /* _LTTNGERR_H */
This page took 0.023815 seconds and 4 git commands to generate.