2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

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>
This commit is contained in:
Dmitry Safonov 2018-02-07 12:48:46 +00:00 committed by Andrei Vagin
parent 5a7248bda2
commit 8dcc764b86

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