X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=daef71fdbc90646be59ebc781131a59688ad6c0c;hb=a0377dfefe40662ba7d68617bce6ff467114136c;hp=c4aa4012aa4aaed38c0e1a25154c78419467f0c0;hpb=edf4b93e2f5c849cbec49e987990b3705ea49f6a;p=lttng-tools.git diff --git a/src/common/error.h b/src/common/error.h index c4aa4012a..daef71fdb 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -44,7 +44,7 @@ struct log_time { char str[19]; }; extern DECLARE_URCU_TLS(struct log_time, error_log_time); -extern DECLARE_URCU_TLS(const char *, logger_thread_name); +extern LTTNG_HIDDEN DECLARE_URCU_TLS(const char *, logger_thread_name); extern int lttng_opt_quiet; extern int lttng_opt_verbose; @@ -221,7 +221,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) DBG3(fmt, ## args); \ break; \ default: \ - assert(0); \ + abort(); \ } \ } while(0); @@ -232,23 +232,24 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) /* * Version using XSI strerror_r. */ -#define PERROR(call, args...) \ - do { \ - char buf[200]; \ - strerror_r(errno, buf, sizeof(buf)); \ - _PERROR(call ": %s", ## args, buf); \ - } while(0); +#define PERROR(call, args...) \ + do { \ + char _perror_buf[200]; \ + strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \ + _PERROR(call ": %s", ##args, _perror_buf); \ + } while (0); #else /* * Version using GNU strerror_r, for linux with appropriate defines. */ -#define PERROR(call, args...) \ - do { \ - char *buf; \ - char tmp[200]; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - _PERROR(call ": %s", ## args, buf); \ - } while(0); +#define PERROR(call, args...) \ + do { \ + char *_perror_buf; \ + char _perror_tmp[200]; \ + _perror_buf = strerror_r( \ + errno, _perror_tmp, sizeof(_perror_tmp)); \ + _PERROR(call ": %s", ##args, _perror_buf); \ + } while (0); #endif const char *error_get_str(int32_t code);