[net.sources.bugs] DIRED

ksbszabo@wateng.UUCP (Kevin Szabo) (01/26/85)

It seems that there is a bit of a race condition when the signal
catcher redefines what to do with the signal and sends the signal
to itself. For the 4.2 version I changed the signal it sends to
be the non-catchable SIGSTOP. Only four lines have been added but
I'll send the whole routine so you can see the context. Sorry,
you can't use this with PATCH since I editted the original (yes, dangerous).

				Kevin
onctlz ()
{
  curxy (0, Tscrlen);
  ceol (0,Tscrlen);
  unsetdpy();
  signal(SIGTSTP,SIG_DFL);
#ifdef V4P2
  kill(0,SIGSTOP); /*re-send ^z, This one can't be caught. ksbszabo */
#else
  kill(0,SIGTSTP); /*re-send ^z */
#endif
  signal(SIGTSTP,onctlz);  /* wake up here ... */
  setdpy();
  blank();
  showscreen();
  if (!intype) telluser("");
  else {
    curxy (0, Tscrlen);
    ceol (0,Tscrlen);
  }
}
-- 
Kevin Szabo  watmath!wateng!ksbszabo (U of Waterloo VLSI Group, Waterloo Ont.)

guy@rlgvax.UUCP (Guy Harris) (02/16/85)

> It seems that there is a bit of a race condition when the (SIGTSTP) signal
> catcher redefines what to do with the signal and sends the signal
> to itself. For the 4.2 version I changed the signal it sends to
> be the non-catchable SIGSTOP.

This same bug occurs if you try to run the S5R2 curses/terminfo package
on a 4.2BSD system; the solution that the old curses package used was just
to reset the signal handler for SIGTSTP to SIG_DFL at the beginning of
the handler (in effect, reimplementing the bad old pre-4.2 signal
handling).

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy