From 6f07f2b44463db9a7e5cd0b1ed0b764a08224fc0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 27 Mar 2019 19:44:50 +0100 Subject: [PATCH] tweaks: rename a function plus parameter, to stay closer to what it does --- src/nano.c | 7 +++---- src/proto.h | 2 +- src/text.c | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/nano.c b/src/nano.c index a2c39048..47a7fe0e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1362,15 +1362,14 @@ void regenerate_screen(void) total_refresh(); } -/* 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) +/* Block or unblock the SIGWINCH signal, depending on the blockit parameter. */ +void block_sigwinch(bool blockit) { sigset_t winch; sigemptyset(&winch); sigaddset(&winch, SIGWINCH); - sigprocmask(allow ? SIG_UNBLOCK : SIG_BLOCK, &winch, NULL); + sigprocmask(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL); } /* Handle the global toggle specified in flag. */ diff --git a/src/proto.h b/src/proto.h index 4b6528f0..9283b86c 100644 --- a/src/proto.h +++ b/src/proto.h @@ -427,7 +427,7 @@ RETSIGTYPE do_continue(int signal); #ifndef NANO_TINY RETSIGTYPE handle_sigwinch(int signal); void regenerate_screen(void); -void allow_sigwinch(bool allow); +void block_sigwinch(bool blockit); void do_toggle(int flag); void enable_signals(void); #endif diff --git a/src/text.c b/src/text.c index 5f8843e7..11830084 100644 --- a/src/text.c +++ b/src/text.c @@ -2655,11 +2655,11 @@ const char *do_alt_speller(char *tempfile_name) #ifndef NANO_TINY /* Block SIGWINCHes while waiting for the alternate spell checker's end, * so nano doesn't get pushed past the wait(). */ - allow_sigwinch(FALSE); + block_sigwinch(TRUE); #endif wait(&alt_spell_status); #ifndef NANO_TINY - allow_sigwinch(TRUE); + block_sigwinch(FALSE); #endif /* Reenter curses mode. */