On Tue, Jun 20, 2017 at 09:13:54PM -0500, Derek Martin wrote:
> On Tue, Jun 20, 2017 at 03:47:50PM -0700, Kevin J. McCarthy wrote:
> > The most recent commit (219b9064cf28) added a sigprocmask blocking
> > SIGWINCH during connect(), because FreeBSD was interrupting in that
> > case.
> 
> Why block the signal?  Why not just handle EINTR when connect()
> returns?  Has these advantages:
> 
>  - Is valid C code on every platform Mutt runs on, so no special-case
>  - Does not need to care about (or think about) any #defines
>  - it does not interfere with signal delivery, so redraw will behave
>    (approximately) the same way across platforms regardless of
>    SA_RESTART semantics
> 
> Downsides?  I can't think of any.

During a few searches,
http://www.madore.org/~david/computers/connect-intr.html turned up,
which implied handling EINTR for connect is not a simple affair: you
have to select/poll instead of just being able to re-call.

The redraw should behave the same way, because the blocking merely
delays the signal processing until it is unblocked.  So mutt should
handle the redraw back in its normal loop as per usual.

My main concern was in mutt_block_signals() [signal.c], where the code
for the SIGWINCH was surrounded by the #if.  It makes sense to do so in
mutt_signal_init() because we obviously don't want/need to install a
handler when there is no support.  But I didn't understand why the need
to be conditional in mutt_block_signals().  If there is something I'm
missing I'll add to socket_connect() too, but it doesn't look necessary.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to