X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=822dccfedfee1e5ded65db0c716522c9bd814ec8;hb=799e2c4f4ecb595fcb52c3e6affd3b4ec7b5b24e;hp=14b5e7c67ea1eda8f519f2cfe42a48cd32a3a7ca;hpb=373d38732a83167f19c3be89cf9ff238743cdeb0;p=lttng-tools.git diff --git a/src/common/error.h b/src/common/error.h index 14b5e7c67..822dccfed 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -75,29 +75,15 @@ extern int opt_verbose; " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__) #define _PERROR(fmt, args...) \ - __lttng_print(PRINT_ERR, "perror " fmt "\n", ## args) + __lttng_print(PRINT_ERR, "PERROR: " fmt \ + " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__) -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) -/* - * 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); -#else -/* - * Version using GNU strerror_r, for linux with appropriate defines. - */ #define PERROR(call, args...) \ - do { \ + do { \ char *buf; \ char tmp[200]; \ buf = strerror_r(errno, tmp, sizeof(tmp)); \ _PERROR(call ": %s", ## args, buf); \ } while(0); -#endif #endif /* _ERROR_H */