]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
macro: add ret_errno()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 16:21:53 +0000 (17:21 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 16:21:53 +0000 (17:21 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/macro.h

index e011596d219ae64ed0c56793a6108ab688ceec0f..b4c9f4e7c6dfa762cda5f6a698f40398c7cd5b73 100644 (file)
@@ -454,6 +454,12 @@ enum {
                __ret__;                  \
        })
 
+#define ret_errno(__errno__)       \
+       ({                         \
+               errno = __errno__; \
+               -__errno__;        \
+       })
+
 #define free_replace_move_ptr(a, b) \
        ({                          \
                free(a);            \