malloc/tst-mallocfork2: Kill lingering process for unexpected failures
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 20 Feb 2020 17:37:04 +0000 (14:37 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 27 Feb 2020 16:43:57 +0000 (13:43 -0300)
commit5c8aa3849a58f2ef1d12ffb638a98578fbf99172
tree72f8b0b886ba2323bc8e8bb83ff439c140f25181
parent758599bc9dcc5764e862bd9e1613c5d1e6efc5d3
malloc/tst-mallocfork2: Kill lingering process for unexpected failures

If the test fails due some unexpected failure after the children
creation, either in the signal handler by calling abort or in the main
loop; the created children might not be killed properly.

This patches fixes it by:

  * Avoid aborting in the signal handler by setting a flag that
    an error has occured and add a check in the main loop.

  * Add a atexit handler to handle kill child processes.

Checked on x86_64-linux-gnu.
malloc/tst-mallocfork2.c