X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=6c239fe56e2ea2c041069490a79d3fff1d3f0284;hb=46b2e23bd6c7ae42838dc5d79cf1d3b0f8da613f;hp=ca5af86cdb56e6519164d8f7486697723a1b495a;hpb=c02841d5e59b2e107b43ae99b8a02eb7a3c1863b;p=lttng-tools.git diff --git a/src/common/error.h b/src/common/error.h index ca5af86cd..6c239fe56 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -89,6 +89,9 @@ extern int lttng_opt_mi; ((type) & (PRINT_WARN | PRINT_ERR | PRINT_BUG))) { \ fprintf(stderr, fmt, ## args); \ } \ + if ((type) & (PRINT_ERR | PRINT_BUG)) { \ + lttng_abort_on_error(); \ + } \ } while (0); /* Three level of debug. Use -v, -vv or -vvv for the levels */ @@ -103,7 +106,7 @@ extern int lttng_opt_mi; #define ERR(fmt, args...) \ __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args) #define WARN(fmt, args...) \ - __lttng_print(PRINT_ERR, "Warning: " fmt "\n", ## args) + __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args) #define BUG(fmt, args...) _ERRMSG("BUG", PRINT_BUG, fmt, ## args) @@ -174,4 +177,6 @@ const char *error_get_str(int32_t code); */ const char *log_add_time(); +void lttng_abort_on_error(void); + #endif /* _ERROR_H */