[CRIU] [PATCH 1/3] check: Use errno to check for prctl error code (for brk setting)
Pavel Emelyanov
xemul at virtuozzo.com
Mon Mar 14 01:31:40 PDT 2016
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/cr-check.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/criu/cr-check.c b/criu/cr-check.c
index 2896b02..c252537 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -196,10 +196,10 @@ static int check_prctl(void)
ret = prctl(PR_SET_MM, PR_SET_MM_BRK, brk(0), 0, 0);
if (ret) {
- if (ret == -EPERM)
+ if (errno == EPERM)
pr_msg("prctl: One needs CAP_SYS_RESOURCE capability to perform testing\n");
else
- pr_msg("prctl: PR_SET_MM is not supported\n");
+ pr_msg("prctl: PR_SET_MM is not supported (errno %d)\n", errno);
return -1;
}
--
2.1.4
More information about the CRIU
mailing list