bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing terminal raises additional signal


From: Thomas Dickey
Subject: Re: Resizing terminal raises additional signal
Date: Mon, 2 Feb 2015 20:44:37 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Feb 02, 2015 at 07:49:06PM +0100, vcoxvco wrote:
> 
> On 02/01/2015 01:33 AM, Thomas Dickey wrote:
> >Disabling the whole _nc_signal_handler() function might provide some
> >additional insight - at least, to see if the signal handlers are the issue,
> >or some other function such as nanosleep() is related.
> 
> I tested a little bit in this direction and found that the problem is
> related to code in
> 
> .../tty/lib_tstp.c:CatchIfDefault
> 
> In line 312ff we have:
> 
> #ifdef SA_RESTART
> #ifdef SIGWINCH
>     if (sig != SIGWINCH)           <=====================
> #endif
>         new_act.sa_flags |= SA_RESTART;
> #endif /* SA_RESTART */
>     new_act.sa_handler = handler;
> 
> 
> Commenting out the line
> 
>     if (sig != SIGWINCH)
> 
> makes my code work as expected, i.e. I explicitly set the restart flag
> also in case of SIGWINCH -  when the system() call returns, KEY_RESIZE
> is delivered correctly.
> 
> So, is there any specific reason not to set the restart flag
> in case of SIGWINCH?

Looking at the source-history, it was for this reason:

20011229
        + restore special case from 20010922 changes to omit SA_RESTART when
          setting up SIGWINCH handler, which is needed to allow wgetch() to be
          interrupted by that signal.

(there of course may be a better solution...)

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]