From: Christian Brauner Date: Tue, 6 Apr 2021 15:22:52 +0000 (+0200) Subject: log: add error_ret() X-Git-Tag: lxc-5.0.0~215^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3cef319e34c5041833387136b89881634fe982c;p=thirdparty%2Flxc.git log: add error_ret() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/log.h b/src/lxc/log.h index e90dadef7..8ee5f9862 100644 --- a/src/lxc/log.h +++ b/src/lxc/log.h @@ -583,6 +583,13 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \ __internal_ret__; \ }) +#define error_ret(__ret__, format, ...) \ + ({ \ + typeof(__ret__) __internal_ret__ = (__ret__); \ + ERROR(format, ##__VA_ARGS__); \ + __internal_ret__; \ + }) + #define syswarn(format, ...) \ ({ \ SYSWARN(format, ##__VA_ARGS__); \