nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] Window resize handling


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] Window resize handling
Date: Mon, 04 May 2015 14:08:29 +0200

Hi Mahyar,

On Sun, May 3, 2015, at 21:23, Mahyar Abbaspour wrote:
> After careful examination, I found out that this is due to use of 
> non-reentrant functions such as newwin() which uses malloc() under the 
> hood in the signal handler. (I was aware of this but somehow I didn't 
> want to heavily change the signal handler design). So I decided to 
> move the content of the hanlde_sigwinch() function to another function 
> and make handle_sigwinch() just a notifier. Having done this, I also 
> decided to block SIGWINCH in the entire program and handle it at one 
> certain point. This makes me able to invoke the non-reentrant routines 
> that are required to regenerate the screen outside of the signal 
> handler. By doing this, I got no more segfaults (as far as I tested).

So far it's looking good -- no glitches, no crashes.

About the code... isn't this whole section superfluous?:

+       if (sigismember(&sigset, SIGWINCH)) {
+               /* Let pending SIGWINCH be delivered. */
+           allow_pending_sigwinch(TRUE);
+           allow_pending_sigwinch(FALSE);
+           regenerate_screen();
+           input = KEY_WINCH;
+       } else

Doesn't it get handled equally fine by what follows?
What am I overlooking?

And the remaining allow_pending_sigwinch(FALSE);
wouldn't it be more logical to place it after
if (sigwinch_flag != sigwinch_flag_save)?

Regards,

Benno

-- 
http://www.fastmail.com - The way an email service should be




reply via email to

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