[LTP] [PATCHv2 3/3] pidns16: child should not get parent pid in parent NS

Monson Shao
2012-12-26T08:49:15Z

parent pid in parent NS is invisible to child, even when child got signalled
from parent, the signaller process should be fake parent (PID 0).

Signed-off-by: Monson Shao <jshao@redhat.com>
---
testcases/kernel/containers/pidns/pidns16.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/testcases/kernel/containers/pidns/pidns16.c b/testcases/kernel/containers/pidns/pidns16.c
index debc8d2..5b8247b 100644
--- a/testcases/kernel/containers/pidns/pidns16.c
+++ b/testcases/kernel/containers/pidns/pidns16.c
@@ -54,7 +54,6 @@

char *TCID = "pidns16";
int TST_TOTAL = 3;
-pid_t globalpid;

/*
* cleanup() - performs all ONE TIME cleanup for this test at
@@ -76,7 +75,7 @@ void child_signal_handler(int sig, siginfo_t * si, void *unused)

switch (c) {
case 1:
- expected_pid = globalpid;
+ expected_pid = PARENT_PID;
break;
case 2:
expected_pid = CHILD_PID;
@@ -138,8 +137,6 @@ int main(int argc, char *argv[])
int status;
pid_t cpid;

- globalpid = getpid();
-
cpid = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, NULL);

if (cpid < 0) {
--
1.7.11.7