mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 10:12:24 +00:00
log: improve %m handling on musl
Fixes: #3961 Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
d63b84d89b
commit
316b8d0589
@ -391,7 +391,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
LXC_FATAL(&locinfo, format, ##__VA_ARGS__); \
|
LXC_FATAL(&locinfo, format, ##__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSTRACE(format, ...) \
|
#define SYSTRACE(format, ...) \
|
||||||
TRACE("%m - " format, ##__VA_ARGS__)
|
TRACE("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -402,7 +402,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSDEBUG(format, ...) \
|
#define SYSDEBUG(format, ...) \
|
||||||
DEBUG("%m - " format, ##__VA_ARGS__)
|
DEBUG("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -414,7 +414,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSINFO(format, ...) \
|
#define SYSINFO(format, ...) \
|
||||||
INFO("%m - " format, ##__VA_ARGS__)
|
INFO("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -425,7 +425,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSNOTICE(format, ...) \
|
#define SYSNOTICE(format, ...) \
|
||||||
NOTICE("%m - " format, ##__VA_ARGS__)
|
NOTICE("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -436,7 +436,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSWARN(format, ...) \
|
#define SYSWARN(format, ...) \
|
||||||
WARN("%m - " format, ##__VA_ARGS__)
|
WARN("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -447,7 +447,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define SYSERROR(format, ...) \
|
#define SYSERROR(format, ...) \
|
||||||
ERROR("%m - " format, ##__VA_ARGS__)
|
ERROR("%m - " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
@ -458,7 +458,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define CMD_SYSERROR(format, ...) \
|
#define CMD_SYSERROR(format, ...) \
|
||||||
fprintf(stderr, "%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, \
|
fprintf(stderr, "%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, \
|
||||||
__func__, ##__VA_ARGS__);
|
__func__, ##__VA_ARGS__);
|
||||||
@ -471,7 +471,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !ENABLE_COVERITY_BUILD
|
#if (defined(__GNU_LIBRARY__) || defined(__MUSL__)) && !ENABLE_COVERITY_BUILD
|
||||||
#define CMD_SYSINFO(format, ...) \
|
#define CMD_SYSINFO(format, ...) \
|
||||||
printf("%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, __func__, \
|
printf("%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, __func__, \
|
||||||
##__VA_ARGS__);
|
##__VA_ARGS__);
|
||||||
|
Loading…
Reference in New Issue
Block a user