From 01b4e71f7ad5a4b56d489bcff9bf4e041e540748 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 14 Oct 2022 15:25:29 +1100 Subject: pasta_start_ns() always ends in parent context The end of pasta_start_ns() has a test against pasta_child_pid, testing if we're in the parent or the child. However we started the child running the pasta_setup_ns function which always exec()s or exit()s, so if we return from the clone() we are always in the parent, making that test unnecessary. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- pasta.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pasta.c b/pasta.c index 48709a5..cbe0b3a 100644 --- a/pasta.c +++ b/pasta.c @@ -226,10 +226,7 @@ void pasta_start_ns(struct ctx *c, int argc, char *argv[]) drop_caps(); - if (pasta_child_pid) { - NS_CALL(pasta_wait_for_ns, c); - return; - } + NS_CALL(pasta_wait_for_ns, c); } /** -- cgit v1.2.3