Commit 3e7d1bd1 by Thomas Parrott

lxc/log: Adds error_log_errno macro

Suggested usage: return error_log_errno(err, "Failed: %s", "some error"); It sets errno to the value of err, then calls SYSERROR with the format and remaining args. It always returns -1. Suggested-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com> Signed-off-by: 's avatarThomas Parrott <thomas.parrott@canonical.com>
parent bc554fdf
......@@ -505,6 +505,13 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
} while (0)
#endif
#define error_log_errno(__errno__, format, ...) \
({ \
errno = __errno__; \
SYSERROR(format, ##__VA_ARGS__); \
-1; \
})
extern int lxc_log_fd;
extern int lxc_log_syslog(int facility);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment