From: Christian Brauner Date: Sat, 7 Dec 2019 16:21:53 +0000 (+0100) Subject: macro: add ret_errno() X-Git-Tag: lxc-4.0.0~78^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9958e6fe7f69871a8452cebf48e9e8da019fa6a0;p=thirdparty%2Flxc.git macro: add ret_errno() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/macro.h b/src/lxc/macro.h index e011596d2..b4c9f4e7c 100644 --- a/src/lxc/macro.h +++ b/src/lxc/macro.h @@ -454,6 +454,12 @@ enum { __ret__; \ }) +#define ret_errno(__errno__) \ + ({ \ + errno = __errno__; \ + -__errno__; \ + }) + #define free_replace_move_ptr(a, b) \ ({ \ free(a); \