compositor: leave no zombie behind
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 27 Aug 2014 10:31:26 +0000 (13:31 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 28 Aug 2014 07:15:46 +0000 (10:15 +0300)
commit23ade621e7cd5ad6b7c08eddbf9f799cd921e2a9
treed6b37e74e838424aa2e9a18088690732456ccee6
parent826dc14ec43b92d992d8cf73cfdfde132c3f814f
compositor: leave no zombie behind

When SIGCHLD fires, we may have more than one zombie to be collected.
Run waitpid() in a loop until no more zombies are found, and clean them
all up.

It looks like the SIGCHLD signalfd does not trigger again for remaining
zombies, so we need the loop.

This works around a crash in text_backend_notified_destroy, which ends
up using stale input_method.client if the sigchld handler is not called.
The crash could be triggered by removing both weston-desktop-shell and
weston-keyboard, so that both would try to respawn and give up, and then
quitting Weston.

Cc: rawoul@gmail.com
Cc: Boyan Ding <stu_dby@126.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
src/compositor.c