Clean-up: common: rename local variables in PERROR
[lttng-tools.git] / src / common / error.h
index ea00ea5f96f7b81eb5bfb045e9ae893e5303644d..8af989e0436fd910678eb994fa7ebef48c63dd0a 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef _ERROR_H
 #define _ERROR_H
 
 #ifndef _ERROR_H
 #define _ERROR_H
 
-#include <errno.h>
+#include <common/compat/errno.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>
@@ -232,23 +232,24 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)
 /*
  * Version using XSI strerror_r.
  */
 /*
  * 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.
  */
 #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);
 #endif
 
 const char *error_get_str(int32_t code);
This page took 0.024116 seconds and 4 git commands to generate.