X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Fusterr-signal-safe.h;h=50137617f6b99c494b22d90df7b54114c6dace14;hb=4041a8a71441f133654c4ca2a187748e08f03b22;hp=bbdad0495e8710e53f6ef996eaa23113ba6927c2;hpb=2b6f437483769831e50886b9f3bc4710b28f4ac9;p=lttng-ust.git diff --git a/include/usterr-signal-safe.h b/include/usterr-signal-safe.h index bbdad049..50137617 100644 --- a/include/usterr-signal-safe.h +++ b/include/usterr-signal-safe.h @@ -15,7 +15,6 @@ #include #include #include -#include "ust-helper.h" #include "ust-tid.h" #include "ust-snprintf.h" @@ -25,9 +24,10 @@ enum ust_err_loglevel { UST_ERR_LOGLEVEL_DEBUG, }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern volatile enum ust_err_loglevel ust_err_loglevel; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void ust_err_init(void); #ifdef LTTNG_UST_DEBUG @@ -100,9 +100,11 @@ do { \ #define PERROR(call, args...) \ do { \ if (ust_err_debug_enabled()) { \ - char buf[200] = "Error in strerror_r()"; \ - strerror_r(errno, buf, sizeof(buf)); \ - ERRMSG("Error: " call ": %s", ## args, buf); \ + char perror_buf[200] = "Error in strerror_r()"; \ + strerror_r(errno, perror_buf, \ + sizeof(perror_buf)); \ + ERRMSG("Error: " call ": %s", ## args, \ + perror_buf); \ } \ } while(0) #else @@ -112,10 +114,12 @@ do { \ #define PERROR(call, args...) \ do { \ if (ust_err_debug_enabled()) { \ - char *buf; \ - char tmp[200]; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - ERRMSG("Error: " call ": %s", ## args, buf); \ + char *perror_buf; \ + char perror_tmp[200]; \ + perror_buf = strerror_r(errno, perror_tmp, \ + sizeof(perror_tmp)); \ + ERRMSG("Error: " call ": %s", ## args, \ + perror_buf); \ } \ } while(0) #endif