fdm: always check for signals after epoll_pwait(), not only on EINTR

This fixes an issue where we, at least on FreeBSD, sometimes get stuck
in epoll_pwait() after the shell has exited.

It turned out to be because the SIGCHLD signal was delivered at the
same time FDs were made readable/writeable. I.e. epoll_pwait()
returned a non-zero value even though it should have been interrupted
by the SIGCHLD.

To avoid having to search the entire signal array *every time*
epoll_pwait() returns, add a flag that is set in the signal
handler. This tells the FDM to scan the signal array after returning
from epoll_pwait().
This commit is contained in:
Daniel Eklöf 2021-05-21 20:00:45 +02:00
parent b75bd6507a
commit 890dbc49cf
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 22 additions and 15 deletions

View file

@ -110,6 +110,9 @@
scaling factor > 1 (https://codeberg.org/dnkl/foot/issues/509).
* Crash caused by certain CSI sequences with very large parameter
values (https://codeberg.org/dnkl/foot/issues/522).
* Rare occurrences where the window did not close when the shell
exited. Only seen on FreeBSD
(https://codeberg.org/dnkl/foot/issues/534)
### Security