Article View: net.sources.bugs
Article #908Bug fix to ispell
From: Rob McMahon
Date: Mon, 19 Jan 1987 10:53
Date: Mon, 19 Jan 1987 10:53
87 lines
2886 bytes
2886 bytes
<munch>
DESCRIPTION
ispell may loop endlessly if fired off in the background (or if the
fixes from pedz@bobcat aren't installed and you aren't on a VAX).
REPEAT BY
ispell file &
ps
ps
FIX
The masks used in the sigsetmasks in term.c are wrong, they should be
(1<<(sig-1)), not just (1<<sig). Hence SIGTTOU is blocked just before
the kill(0, SIGTTOU). Context diffs follow, apply to term.c with
patch. (these are after applying the mods from pedz@bobkat - although
I don't think they conflict, line numbers may vary. You really ought
to at least install the short->int for TIOCGPGRP though).
RCS file: term.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** /tmp/,RCSt1029193 Mon Jan 19 09:49:15 1987
--- /tmp/,RCSt2029193 Mon Jan 19 09:49:16 1987
***************
*** 10,15
#include <signal.h>
#include "ispell.h"
int putch();
erase ()
--- 10,19 -----
#include <signal.h>
#include "ispell.h"
+ #ifndef sigmask
+ #define sigmask(s) (1 << ((s)-1))
+ #endif
+
int putch();
erase ()
***************
*** 65,71
extern short ospeed;
retry:
! sigsetmask(1<<SIGTSTP | 1<<SIGTTIN | 1<<SIGTTOU);
if (ioctl(0, TIOCGPGRP, &tpgrp) != 0) {
fprintf (stderr, "Can't deal with non interactive use yet.\n");
exit (1);
--- 69,75 -----
extern short ospeed;
retry:
! sigsetmask(sigmask(SIGTSTP) | sigmask(SIGTTIN) | sigmask(SIGTTOU));
if (ioctl(0, TIOCGPGRP, &tpgrp) != 0) {
fprintf (stderr, "Can't deal with non interactive use yet.\n");
exit (1);
***************
*** 71,77
exit (1);
}
if (tpgrp != getpgrp(0)) { /* not in foreground */
! sigsetmask(1<<SIGTSTP | 1<<SIGTTIN);
signal(SIGTTOU, SIG_DFL);
kill(0, SIGTTOU);
/* job stops here waiting for SIGCONT */
--- 75,81 -----
exit (1);
}
if (tpgrp != getpgrp(0)) { /* not in foreground */
! sigsetmask(sigmask(SIGTSTP) | sigmask(SIGTTIN));
signal(SIGTTOU, SIG_DFL);
kill(0, SIGTTOU);
/* job stops here waiting for SIGCONT */
--
--
UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037
JANET: cudcv@uk.ac.warwick.daisy ARPA: cudcv@daisy.warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Technical Details
Message-ID:
<318@sol.warwick.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!warwick!cudcvShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: net.sources.bugs Subject: Bug fix to ispell Message-ID: <318@sol.warwick.ac.uk> Date: Mon, 19-Jan-87 05:53:28 EST Article-I.D.: sol.318 Posted: Mon Jan 19 05:53:28 1987 Date-Received: Wed, 21-Jan-87 02:09:21 EST Reply-To: cudcv@sol.warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 87