Bug fix to ispell
Rob McMahon
cudcv at warwick.ac.uk
Mon Jan 19 20:53:28 AEST 1987
<munch>
DESCRIPTION
ispell may loop endlessly if fired off in the background (or if the
fixes from pedz at 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 at 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 at uk.ac.warwick.daisy ARPA: cudcv at daisy.warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
More information about the Comp.sources.bugs
mailing list