]> 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>
Sun, 8 Dec 2019 01:28:22 +0000 (02:28 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/macro.h

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