[CRIU] [PATCH v3 1/5] tests: only wait for the pid we spawned
Andrew Vagin
avagin at virtuozzo.com
Mon Jul 18 15:12:11 PDT 2016
On Wed, Jul 13, 2016 at 03:10:53PM +0000, Tycho Andersen wrote:
> In the next patch, we'll introduce an option to allow for leaving zombie
> processes in the pid ns for the test so that we can test the behavior of
> zombies. Let's not reap everything after restore, since we'll reap the
> restored zombies as well.
>
> v2: restore the old behavior when in reap mode
>
for the first 4 patches: Acked-by: Andrew Vagin <avagin at virtuozzo.com>
> CC: Andrey Vagin <avagin at openvz.org>
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
> test/zdtm/lib/ns.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
> index b432f54..8c67abe 100644
> --- a/test/zdtm/lib/ns.c
> +++ b/test/zdtm/lib/ns.c
> @@ -338,8 +338,13 @@ int ns_init(int argc, char **argv)
> kill(pid, SIGTERM);
>
> ret = 0;
> - while (ret != -1)
> - ret = wait(NULL);
> + if (reap) {
> + while (ret != -1)
> + ret = wait(NULL);
> + } else {
> + waitpid(pid, NULL, 0);
> + }
> +
>
> exit(1);
> }
> --
> 2.7.4
>
More information about the CRIU
mailing list