zdtm: Add SIGCHLD to clone flags in pidns01

Submitted by Kirill Tkhai on June 9, 2017, 7:41 a.m.

Details

Message ID 149699410917.9166.3373136128684014839.stgit@localhost.localdomain
State Accepted
Series "zdtm: Add SIGCHLD to clone flags in pidns01"
Commit 37b6f640945754326f6b3a8cefb270ab717a24e0
Headers show

Commit Message

Kirill Tkhai June 9, 2017, 7:41 a.m.
Plain wait() waits only children created with SIGCHLD flag.
Add it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 test/zdtm/static/pidns01.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/pidns01.c b/test/zdtm/static/pidns01.c
index fe8d435a3..70137edc4 100644
--- a/test/zdtm/static/pidns01.c
+++ b/test/zdtm/static/pidns01.c
@@ -116,7 +116,7 @@  int main(int argc, char **argv)
 	}
 	futex_init(futex);
 
-	pid = clone(child_fn, stack + sizeof(stack), CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET, NULL);
+	pid = clone(child_fn, stack + sizeof(stack), CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD, NULL);
 	if (pid < 0) {
 		fail("clone");
 		return 1;

Comments

Andrey Vagin June 13, 2017, 10:41 p.m.
Applied, thanks
On Fri, Jun 09, 2017 at 10:41:53AM +0300, Kirill Tkhai wrote:
> Plain wait() waits only children created with SIGCHLD flag.
> Add it.
> 
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> ---
>  test/zdtm/static/pidns01.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/zdtm/static/pidns01.c b/test/zdtm/static/pidns01.c
> index fe8d435a3..70137edc4 100644
> --- a/test/zdtm/static/pidns01.c
> +++ b/test/zdtm/static/pidns01.c
> @@ -116,7 +116,7 @@ int main(int argc, char **argv)
>  	}
>  	futex_init(futex);
>  
> -	pid = clone(child_fn, stack + sizeof(stack), CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET, NULL);
> +	pid = clone(child_fn, stack + sizeof(stack), CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD, NULL);
>  	if (pid < 0) {
>  		fail("clone");
>  		return 1;
>