From 0a3b86f90ceac8de887095fc7904851d67fac413 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 6 Apr 2021 17:10:49 +0200 Subject: [PATCH] macro: ensure ret_errno() always returns negative Signed-off-by: Christian Brauner --- src/lxc/macro.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 */ -- 2.47.2