From 8dcc764b86ab65a3035e7f49b4853b8cf07024e7 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Wed, 7 Feb 2018 12:48:46 +0000 Subject: [PATCH] x86/crtools: Add fork() err-path handle Error-path for failed fork(). Looks originally forgotten, oops! Also print a message on failed fork(). Signed-off-by: Dmitry Safonov --- criu/arch/x86/crtools.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c index 69de23b44..d7b21e7c9 100644 --- a/criu/arch/x86/crtools.c +++ b/criu/arch/x86/crtools.c @@ -40,8 +40,10 @@ int kdat_can_map_vdso(void) * it for criu accidentally. */ child = fork(); - if (child < 0) + if (child < 0) { + pr_perror("%s(): failed to fork()", __func__); return -1; + } if (child == 0) { int ret; @@ -150,6 +152,11 @@ static int has_32bit_mmap_bug(void) pid_t child = fork(); int stat; + if (child < 0) { + pr_perror("%s(): failed to fork()", __func__); + return -1; + } + if (child == 0) mmap_bug_test();