Commit 3b71b95a authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

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: 's avatarDmitry Safonov <dima@arista.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent f89aa7f3
...@@ -40,8 +40,10 @@ int kdat_can_map_vdso(void) ...@@ -40,8 +40,10 @@ int kdat_can_map_vdso(void)
* it for criu accidentally. * it for criu accidentally.
*/ */
child = fork(); child = fork();
if (child < 0) if (child < 0) {
pr_perror("%s(): failed to fork()", __func__);
return -1; return -1;
}
if (child == 0) { if (child == 0) {
int ret; int ret;
...@@ -150,6 +152,11 @@ static int has_32bit_mmap_bug(void) ...@@ -150,6 +152,11 @@ static int has_32bit_mmap_bug(void)
pid_t child = fork(); pid_t child = fork();
int stat; int stat;
if (child < 0) {
pr_perror("%s(): failed to fork()", __func__);
return -1;
}
if (child == 0) if (child == 0)
mmap_bug_test(); mmap_bug_test();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment