Commit b18482e1 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

simplify the previous fix

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2936 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 13 additions and 16 deletions
+13 -16
...@@ -173,10 +173,8 @@ CVS code - ...@@ -173,10 +173,8 @@ CVS code -
no longer needed, and make the error message more similar to no longer needed, and make the error message more similar to
what the internal spell checker returns under the same what the internal spell checker returns under the same
circumstances. (DLR) circumstances. (DLR)
- Set the SIGWINCH handler back to the default just before - Block any pending SIGWINCHes while the alternate spell checker
running the alternate spell checker, so that the alternate is running, so that it can handle them. (DLR)
spell checker can handle them, and set it back afterwards.
(DLR)
do_spell() do_spell()
- When displaying an error message from do_(int|alt)_speller(), - When displaying an error message from do_(int|alt)_speller(),
don't display the error message corresponding to errno if don't display the error message corresponding to errno if
......
...@@ -1846,8 +1846,6 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1846,8 +1846,6 @@ const char *do_alt_speller(char *tempfile_name)
size_t totsize_save = openfile->totsize; size_t totsize_save = openfile->totsize;
/* Our saved value of totsize, used when we spell-check a marked /* Our saved value of totsize, used when we spell-check a marked
* selection. */ * selection. */
struct sigaction newaction, oldaction;
/* Original and temporary handlers for SIGWINCH. */
if (old_mark_set) { if (old_mark_set) {
/* If the mark is on, save the number of the line it starts on, /* If the mark is on, save the number of the line it starts on,
...@@ -1874,13 +1872,6 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1874,13 +1872,6 @@ const char *do_alt_speller(char *tempfile_name)
} }
spellargs[arglen - 2] = tempfile_name; spellargs[arglen - 2] = tempfile_name;
/* Save the original SIGWINCH handler, and set the SIGWINCH handler
* back to the default, so that the alternate spell checker can
* handle a SIGWINCH its own way. */
sigaction(SIGWINCH, NULL, &newaction);
newaction.sa_handler = SIG_DFL;
sigaction(SIGWINCH, &newaction, &oldaction);
/* Start a new process for the alternate speller. */ /* Start a new process for the alternate speller. */
if ((pid_spell = fork()) == 0) { if ((pid_spell = fork()) == 0) {
/* Start alternate spell program; we are using PATH. */ /* Start alternate spell program; we are using PATH. */
...@@ -1894,11 +1885,19 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -1894,11 +1885,19 @@ const char *do_alt_speller(char *tempfile_name)
if (pid_spell < 0) if (pid_spell < 0)
return _("Could not fork"); return _("Could not fork");
/* Wait for alternate speller to complete. */ #ifndef NANO_SMALL
/* Don't handle a pending SIGWINCH until the alternate spell checker
* is finished. */
allow_pending_sigwinch(FALSE);
#endif
/* Wait for the alternate spell checker to finish. */
wait(&alt_spell_status); wait(&alt_spell_status);
/* Set the SIGWINCH handler back to the original. */ #ifndef NANO_SMALL
sigaction(SIGWINCH, &oldaction, NULL); /* Handle a pending SIGWINCH again. */
allow_pending_sigwinch(TRUE);
#endif
refresh(); refresh();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment