[news.software.b] rnews -U locking via .rnews.lock is broken in 2.11.17

news@fesk.UUCP (news) (01/30/89)

When spooling news and executing rnews -U from cron once an hour
I get multiple copies of rnews -U running at the same time.  I have
tracked this down to one line of severely broken code in inews.c
for the case of locking via the lock file SPOOL/.rnews.lock
The patch below (hopefully) corrects the problem.

*** save/inews.c	Wed Jan 25 14:28:10 1989
--- inews.c	Sun Jan 29 16:04:51 1989
***************
*** 1540,1546
  	/* assume a dead lock if the active file is over 12 hours old */
  	if (ret < 0 &&
  		(errno != EEXIST ||
! 		(stat(bfr, &stbuf) == 0 &&
  		(time((char *)0) - stbuf.st_mtime) < DAYS/2))) {
  			if (errno != EEXIST)
  #endif /* V7 */

--- 1540,1546 -----
  	/* assume a dead lock if the active file is over 12 hours old */
  	if (ret < 0 &&
  		(errno != EEXIST ||
! 		(stat(spbuf, &stbuf) != 0 ||
  		(time((char *)0) - stbuf.st_mtime) < DAYS/2))) {
  			if (errno != EEXIST)
  #endif /* V7 */