]> git.proxmox.com Git - mirror_lxc.git/commitdiff
src/lxc/log.h: fix STRERROR_R_CHAR_P
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 14 Jul 2022 10:31:21 +0000 (12:31 +0200)
committerFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 14 Jul 2022 10:33:17 +0000 (12:33 +0200)
STRERROR_R_CHAR_P is always defined to 0 or 1 depending on the value of
have_func_strerror_r_char_p in meson.build so replace #ifdef by #if to
avoid a redefinition build failure if char *strerror_r is not defined

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
src/lxc/log.h

index 554a2e1d483a74d67b9f347febac0af1fc4b46b3..fcddc679a8eabdc8587b01ca4f14d0ffcc894934 100644 (file)
@@ -304,13 +304,13 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo,      \
  * Helper macro to define errno string.
  */
 #if HAVE_STRERROR_R
-       #ifdef STRERROR_R_CHAR_P
+       #if STRERROR_R_CHAR_P
        char *strerror_r(int errnum, char *buf, size_t buflen);
        #else
        int strerror_r(int errnum, char *buf, size_t buflen);
        #endif
 
-       #ifdef STRERROR_R_CHAR_P
+       #if STRERROR_R_CHAR_P
                #define lxc_log_strerror_r                                               \
                        char errno_buf[PATH_MAX / 2] = {"Failed to get errno string"};   \
                        char *ptr = NULL;                                                \