[CRIU] [PATCH 2/3] check: Use errno to check for prctl error code (for exe file)

Pavel Emelyanov xemul at virtuozzo.com
Mon Mar 14 01:32:20 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 10872d5..560bc07 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -204,8 +204,8 @@ static int check_prctl(void)
 		}
 
 		ret = prctl(PR_SET_MM, PR_SET_MM_EXE_FILE, -1, 0, 0);
-		if (ret != -EBADF) {
-			pr_msg("prctl: PR_SET_MM_EXE_FILE is not supported (%d)\n", ret);
+		if (ret && errno != EBADF) {
+			pr_msg("prctl: PR_SET_MM_EXE_FILE is not supported (%d)\n", errno);
 			return -1;
 		}
 
-- 
2.1.4



More information about the CRIU mailing list