2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

kerndat: Make errors from clone3() check more precise.

Signed-off-by: Michał Mirosław <emmir@google.com>
This commit is contained in:
Michał Mirosław 2023-08-24 20:54:20 +02:00 committed by Andrei Vagin
parent badf8060c6
commit d5284313f5

View File

@ -1417,17 +1417,20 @@ static bool kerndat_has_clone3_set_tid(void)
*/
pid = syscall(__NR_clone3, &args, sizeof(args));
if (pid == -1 && (errno == ENOSYS || errno == E2BIG)) {
kdat.has_clone3_set_tid = false;
return 0;
}
if (pid == -1 && errno == EINVAL) {
kdat.has_clone3_set_tid = true;
} else {
pr_perror("Unexpected error from clone3");
if (pid != -1) {
pr_err("Unexpected success: clone3() returned %d\n", pid);
return -1;
}
if (errno == ENOSYS || errno == E2BIG)
return 0;
if (errno != EINVAL) {
pr_pwarn("Unexpected error from clone3");
return 0;
}
kdat.has_clone3_set_tid = true;
return 0;
}