[comp.windows.x] Minor twm fix

bph_cwjb@jhunix.HCF.JHU.EDU (William J. Bogstad) (06/17/88)

	The twm window manager is a nice piece of work, but it has a
fatal flaw when used with the Bourne shell.  Programs running in the
background from "sh" remain in the same process group as the interactive
shell and are only protected by the fact that "sh" arranges for its
background children to do a signal(X, SIG_IGN) for all of the keyboard
generated signals.  The small patch below will cause twm to correctly
deal with this convention.

				Bill Bogstad

*** twm.c.old	Thu Jun 16 14:42:29 1988
--- twm.c	Thu Jun 16 14:41:25 1988
***************
*** 207,216 ****
  	}
      }
  
!     signal(SIGINT, Done);
!     signal(SIGQUIT, Done);
!     signal(SIGHUP, Done);
!     signal(SIGTERM, Done);
  
      Home = (char *)getenv("HOME");
      if (Home == NULL)
--- 207,220 ----
  	}
      }
  
!     if(signal(SIGINT, Done) == SIG_IGN)
! 	signal(SIGINT, SIG_IGN);
!     if(signal(SIGQUIT, Done) == SIG_IGN)
! 	signal(SIGQUIT, SIG_IGN);
!     if(signal(SIGHUP, Done) == SIG_IGN)
! 	signal(SIGHUP, SIG_IGN);
!     if(signal(SIGTERM, Done) == SIG_IGN)
! 	signal(SIGTERM, SIG_IGN);
  
      Home = (char *)getenv("HOME");
      if (Home == NULL)
-- 
Bill Bogstad				bogstad@cs.jhu.edu
Work: (301)338-8019			bill@green.bph.jhu.edu