2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 16:14:12 +00:00

log: add CMD_SYSERROR()

Add a thread-safe and uniform way to retrieve errno values in programs that are
shipped as part of LXC but are not expected to have access to the logging
system.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2018-08-16 13:01:54 +02:00
parent 7a8e91c1fc
commit bb9623e705

View File

@@ -429,6 +429,12 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
ERROR("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
#define CMD_SYSERROR(format, ...) \
do { \
lxc_log_strerror_r; \
fprintf(stderr, "%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
extern int lxc_log_fd;
extern int lxc_log_syslog(int facility);