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 <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Dmitry Safonov 2018-02-07 12:48:46 +00:00 committed by Andrei Vagin
parent f89aa7f35b
commit 3b71b95a19

View file

@ -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();