On Sat, Nov 07, 2020 at 01:06:00PM +0100, Matthias Apitz wrote:
There is only a small issue with the handling of SIGCHLD by Mutt which
leads to an error message by Mutt that the mail wasn't sent (to STDOUT),
which is not even true, because was sent fine.
----- Forwarded message from "Kevin J. McCarthy" <ke...@8t8.us> -----
Mutt by default sets SIGCHLD to an empty signal handler function (for 1.8.3).
For more recent versions, the handler sets a global variable (which is used
for background editing process management).
During the fork/exec process for sendmail (and other places), Mutt does set up
SIG_BLOCK for SIGCHLD.
it's correct to do that around the fork(), but it strikes me as unwise
to do the waitpid() with blocked sigchld - such practice was
historically problematic, iirc.
the proposed patch definitely isn't a good idea, as it just papers over
the real problem, whatever it might be.
fwiw, the incomplete errno handling around the waitpid() calls doesn't
really help, though we know from the strace that it's indeed ECHILD in
this case.
_mutt_system() contains quite similar code, but builds with IMAP support
use a different code path that unmasks all signals during the polling.