DIRED (distributed months ago) goes into infinite loop with SIGTSTP

Kevin Szabo ksbszabo at wateng.UUCP
Sat Jan 26 09:13:35 AEST 1985


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.)



More information about the Comp.sources.bugs mailing list