This is safer: _exit is guaranteed at the call site regardless of what the function does internally. Also it makes clone_child_func() and unshare_child_func() follow the same scheme.
https://virtuozzo.atlassian.net/browse/VSTOR-129744 Fixes: 4fe045fa7c00a ("selftests/ve: regression test for CLONE_NEWVE owner correctness") Signed-off-by: Pavel Tikhomirov <[email protected]> --- tools/testing/selftests/ve/ve_ns_owner_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/ve/ve_ns_owner_test.c b/tools/testing/selftests/ve/ve_ns_owner_test.c index d9cb66bb0df64..b5b4f10be72b9 100644 --- a/tools/testing/selftests/ve/ve_ns_owner_test.c +++ b/tools/testing/selftests/ve/ve_ns_owner_test.c @@ -177,11 +177,11 @@ static int clone_child_func(void *arg) close(ctx->sync.parent_to_child[1]); if (write(ctx->sync.child_to_parent[1], "R", 1) != 1) - _exit(11); + return 11; if (read(ctx->sync.parent_to_child[0], &ack, 1) != 1) - _exit(12); + return 12; - _exit(0); + return 0; } /* @@ -317,7 +317,7 @@ TEST_F(ve_ns_owner, clone_newve_newnet_newns) pid = syscall(__NR_clone3, &cargs, sizeof(cargs)); ASSERT_GE(pid, 0); if (pid == 0) - clone_child_func(&ctx); + _exit(clone_child_func(&ctx)); close(ctx.sync.child_to_parent[1]); close(ctx.sync.parent_to_child[0]); -- 2.54.0 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
