aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-10-14 15:25:29 +1100
committerStefano Brivio <sbrivio@redhat.com>2022-10-15 02:10:36 +0200
commit01b4e71f7ad5a4b56d489bcff9bf4e041e540748 (patch)
treeec2314cfebaeadc3074146f80a431b3451c3f47f
parent672a8cd80ef2a8491901c50757f0f85464550ff4 (diff)
downloadpasst-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar.gz
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar.bz2
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar.lz
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar.xz
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.tar.zst
passt-01b4e71f7ad5a4b56d489bcff9bf4e041e540748.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--pasta.c5
1 files changed, 1 insertions, 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);
}
/**