From 9e6b9a29a502bb04a259911d610714325d699931 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 4 Jan 2016 10:37:11 +0000 Subject: [PATCH] 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 --- ChangeLog | 1 + src/nano.c | 7 +++---- src/proto.h | 2 +- src/text.c | 18 ++++++++---------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3330c6ec..7036bd45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 * src/global.c (strtosc, strtomenu): Constify the input parameter. diff --git a/src/nano.c b/src/nano.c index d4366b93..29f0e571 100644 --- a/src/nano.c +++ b/src/nano.c @@ -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; diff --git a/src/proto.h b/src/proto.h index 74280edd..29796224 100644 --- a/src/proto.h +++ b/src/proto.h @@ -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); diff --git a/src/text.c b/src/text.c index e0c10c8f..b73f7f2f 100644 --- a/src/text.c +++ b/src/text.c @@ -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 -- 2.39.5