[CRIU] [PATCH 2/7] tests: add a ZDTM_NOREAP variable
Pavel Emelyanov
xemul at virtuozzo.com
Tue Jun 28 05:42:45 PDT 2016
On 06/23/2016 06:13 PM, Tycho Andersen wrote:
> We'll use this variable in the next test to make sure the test suite
> doesn't accidentally reap the zombie we want to leave around for the actual
> test.
>
> This is kind of ugly and there might be a better way to pass information to
> the test's init, I'm open for suggestions :)
That's (hopefully) fine, but I have concern about patch #1 -- can we keep
original behavior (wait in a loop) if NOREAP is _not_ given? The thing is
that ns init is supposed to pick up a lot of trash, not only the one _it_
has explicitly spawned.
> @@ -290,12 +295,12 @@ int ns_init(int argc, char **argv)
>
> show_ps();
>
> - if (sigaction(SIGCHLD, &sa, NULL)) {
> + if (reap && sigaction(SIGCHLD, &sa, NULL)) {
> fprintf(stderr, "Can't set SIGCHLD handler: %m\n");
> exit(1);
> }
>
> - while (1) {
> + while (reap && 1) {
%) Why?!
> int status;
>
> pid = waitpid(-1, &status, WNOHANG);
>
More information about the CRIU
mailing list