Improving the name of allow_pending_sigwinch() to allow_sigwinch(),

and improving its comments too.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-01-04 10:37:11 +00:00
parent 0dd351a5c1
commit 9e6b9a29a5
4 changed files with 13 additions and 15 deletions

View File

@ -3,6 +3,7 @@
only once, so there is no longer any need to free existing ones.
* src/global.c (sctofunc): Rewrite the loop, and constify the input.
* src/text.c (do_linter): Condense the exit code.
* src/nano.c (allow_sigwinch): Improve its name and its comments.
2016-01-04 Mike Frysinger <vapier@gentoo.org>
* src/global.c (strtosc, strtomenu): Constify the input parameter.

View File

@ -1419,10 +1419,9 @@ void regenerate_screen(void)
total_refresh();
}
/* If allow is FALSE, block any SIGWINCH signals that we get, so that
* we can deal with them later. If allow is TRUE, unblock any SIGWINCH
* signals that we have, so that we can deal with them now. */
void allow_pending_sigwinch(bool allow)
/* If allow is FALSE, block any SIGWINCH signal. If allow is TRUE,
* unblock SIGWINCH so any pending ones can be dealt with. */
void allow_sigwinch(bool allow)
{
sigset_t winch;

View File

@ -491,7 +491,7 @@ RETSIGTYPE do_continue(int signal);
#ifndef NANO_TINY
RETSIGTYPE handle_sigwinch(int signal);
void regenerate_screen(void);
void allow_pending_sigwinch(bool allow);
void allow_sigwinch(bool allow);
void do_toggle(int flag);
#endif
void do_toggle_void(void);

View File

@ -2740,9 +2740,8 @@ const char *do_alt_speller(char *tempfile_name)
return _("Could not fork");
#ifndef NANO_TINY
/* Don't handle a pending SIGWINCH until the alternate spell checker
* is finished and we've loaded the spell-checked file back in. */
allow_pending_sigwinch(FALSE);
/* Block SIGWINCHes so the spell checker doesn't get any. */
allow_sigwinch(FALSE);
#endif
/* Wait for the alternate spell checker to finish. */
@ -2830,8 +2829,8 @@ const char *do_alt_speller(char *tempfile_name)
set_modified();
#ifndef NANO_TINY
/* Handle a pending SIGWINCH again. */
allow_pending_sigwinch(TRUE);
/* Unblock SIGWINCHes again. */
allow_sigwinch(TRUE);
#endif
return NULL;
@ -3289,9 +3288,8 @@ void do_formatter(void)
}
#ifndef NANO_TINY
/* Don't handle any SIGWINCHes until the formatter has finished and
* we've loaded the reformatted file back in. */
allow_pending_sigwinch(FALSE);
/* Block SIGWINCHes so the formatter doesn't get any. */
allow_sigwinch(FALSE);
#endif
/* Wait for the formatter to finish. */
@ -3327,8 +3325,8 @@ void do_formatter(void)
free(temp);
#ifndef NANO_TINY
/* Handle SIGWINCHes again. */
allow_pending_sigwinch(TRUE);
/* Unblock SIGWINCHes again. */
allow_sigwinch(TRUE);
#endif
/* If the formatter printed any error messages onscreen, make