]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
log: add error_ret()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 6 Apr 2021 15:22:52 +0000 (17:22 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 7 Apr 2021 07:38:36 +0000 (09:38 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/log.h

index e90dadef7dbd23f12c97167e41c32291fc27fcc2..8ee5f9862322528173216183d17c4c16fcbe9d35 100644 (file)
@@ -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__); \