X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=d656625d1fa56381102afce29c897a75cd2e6fe6;hb=395004a13b038fde13364a662d735d16937ea2d1;hp=ea00ea5f96f7b81eb5bfb045e9ae893e5303644d;hpb=f5fb86c1254b785eee8caf87cb996d33eda0ede9;p=lttng-tools.git diff --git a/src/common/error.h b/src/common/error.h index ea00ea5f9..d656625d1 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -1,14 +1,14 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * - * SPDX-License-Identifier: GPL-2.0-only + * SPDX-License-Identifier: LGPL-2.1-only * */ #ifndef _ERROR_H #define _ERROR_H -#include +#include #include #include #include @@ -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; @@ -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);