From: Christian Brauner Date: Tue, 6 Apr 2021 15:10:49 +0000 (+0200) Subject: macro: ensure ret_errno() always returns negative X-Git-Tag: lxc-5.0.0~215^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a3b86f90ceac8de887095fc7904851d67fac413;p=thirdparty%2Flxc.git macro: ensure ret_errno() always returns negative Signed-off-by: Christian Brauner --- diff --git a/src/lxc/macro.h b/src/lxc/macro.h index 4c13f8335..42f95c235 100644 --- a/src/lxc/macro.h +++ b/src/lxc/macro.h @@ -663,10 +663,10 @@ enum { __internal_ret__; \ }) -#define ret_errno(__errno__) \ - ({ \ - errno = (__errno__); \ - -(__errno__); \ +#define ret_errno(__errno__) \ + ({ \ + errno = labs(__errno__); \ + -errno; \ }) /* Container's specific file/directory names */