[CRIU] [PATCHv2 1/9] x86/crtools: Add fork() err-path handle

Dmitry Safonov dima at arista.com
Wed Feb 7 15:48:46 MSK 2018


Error-path for failed fork().
Looks originally forgotten, oops!
Also print a message on failed fork().

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 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 69de23b44982..d7b21e7c9bae 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();
 
-- 
2.13.6



More information about the CRIU mailing list