chiark / gitweb /
server/admin: Fix client destruction some more.
It's possible that finally destroying a client can kill others. For
example, if the second client (a) has sent EOF, and (b) has a background
command outstanding with the first; then when the first sends EOF, the
second gets taken down too.
Unfortunately, what actually happens in this case is that the newly
defunct clients get put on the dead list -- and then ignored because the
dead list is silently killed at the end of a_destroypending. Fix by
clearing the list at the top of a_destroypending, and doing the whole
job repeatedly until there are no more cascades.
The change is mostly indenting a loop: it looks less scary with -b.