[net.sources] netnews 2.10.2 visual.c bug

mab@ttidca.UUCP (Michael A. Bloom) (09/11/84)

When trying vnews after compiling it on a 4.1 system, it immediately
stopped, believing itself to be running in the background.

In ttysave(), tpgrp and getpgrp() should be shorts not int's.  The
comment indicates that the code is right from the jobs manual page.
This is incorrect, as the manual page indicates that tpgrp should
be a short.

Now off to find the other problems....
-- 
	Michael A. Bloom	(TTI, Santa Monica)
	 {cadovax,flick,philabs,randvax,trwrb,vortex,wtux2}!ttidca!mab
	 or ttidca!mab@RAND-UNIX.ARPA

rick@seismo.UUCP (Rick Adams) (09/12/84)

The correct fix is:

***************
*** 1989,1995
  #endif !BSD4_2
  	if (ioctl(2, TIOCGPGRP, (char *)&tpgrp) < 0)
  		goto nottty;
! 	if ((0xffff&tpgrp) != (0xffff&getpgrp(0))) { /* not in foreground */
  		signal(SIGTTOU, SIG_DFL);
  #ifdef BSD4_2
  		sigsetmask(sigblock(0) & ~BIT(SIGTTOU));

--- 1991,1997 -----
  #endif !BSD4_2
  	if (ioctl(2, TIOCGPGRP, (char *)&tpgrp) < 0)
  		goto nottty;
! 	if (tpgrp != getpgrp(0)) { /* not in foreground */
  		signal(SIGTTOU, SIG_DFL);
  #ifdef BSD4_2
  		sigsetmask(sigblock(0) & ~BIT(SIGTTOU));

Do not change them to shorts, leave them ints.

---rick