C News patch of 12-Mar-1990

Henry Spencer henry at utzoo.uucp
Wed Mar 14 04:40:17 AEST 1990


This is another collection of small stuff.  Fix some small bugs in the
great build revision; build now will take the saved-answers filename as
an argument if desired; subst now tells you which files (if any) it
changed; the ldiv() function is no longer used; <stdio.h> is now relied
on for the declaration of sprintf(), eliminating the question of what
type it returns; several error messages improved; newsgroup-matching
algorithm refined, improved, and precisely documented (!!!); lazy
cache refills in relaynews; documentation on a specialized reason why
relaynews might exit with status 1; further additions to the porting-
problems document; relaynews now invokes dbmclose() in preparation for
the dbz cutover; fix bug in relaynews fallback to symlinks if hard links
fail; the usual minor cleanups and fixes.

start of patch 12-Mar-1990
(suggested archive name: `pch12Mar90.Z')
this should be run with   patch -p0 <thisfile

Please do the following (there is no easy way we can convince
patch to do this automatically):
rm hfake/stdlib.h
rm libfake/ldiv.c
rm relay/hdrcommon.c

The following is a complete list of patches to date.

Prereq: 23-Jun-1989
Prereq: 7-Jul-1989
Prereq: 23-Jul-1989
Prereq: 22-Aug-1989
Prereq: 24-Aug-1989
Prereq: 14-Sep-1989
Prereq: 13-Nov-1989
Prereq: 10-Jan-1990
Prereq: 16-Jan-1990
Prereq: 17-Jan-1990
Prereq: 18-Jan-1990
*** PATCHDATES.old	Mon Mar 12 13:38:16 1990
--- PATCHDATES	Mon Mar 12 13:38:16 1990
***************
*** 1,11 ****
--- 1,12 ----
  23-Jun-1989
  7-Jul-1989
  23-Jul-1989
  22-Aug-1989
  24-Aug-1989
  14-Sep-1989
  13-Nov-1989
  10-Jan-1990
  16-Jan-1990
  17-Jan-1990
  18-Jan-1990
+ 12-Mar-1990

Changed files, if any:

*** cnpatch/old/README	Fri Jun 23 14:45:40 1989
--- README	Wed Jan 31 13:23:55 1990
***************
*** 128,132 ****
  
  See ROADMAP for a run-down on what's where in the distribution.  See
! doc/install for how to install it.  Conf/build is the interactive setup
  program that does most of the work, or rather, sets up shell files which,
  when run, do most of the work.  Even if your system is odd enough that
--- 128,133 ----
  
  See ROADMAP for a run-down on what's where in the distribution.  See
! doc/install for how to install it.  You may wish to read notebook/problems,
! which discusses common difficulties.  Conf/build is the interactive setup
  program that does most of the work, or rather, sets up shell files which,
  when run, do most of the work.  Even if your system is odd enough that

*** cnpatch/old/conf/build	Thu Jan 18 13:23:58 1990
--- conf/build	Mon Feb 19 15:09:37 1990
***************
*** 5,9 ****
  vars='newsuid newsgid binuid bingid binsrc mess unmess newsarts newsctl
  	newsbin newsumask newsmaster newsconfig chown chboth chgrp unixkind
! 	addrsize dbmopt faststdio storeval faststrchr sete sprintfchar ranlib
  	symdef cc copts ldopts postlibs hostname uname uucptype dftype dfdirs
  	archive spacelow nfsgroup server manpages manmess rbin doui bin atok
--- 5,9 ----
  vars='newsuid newsgid binuid bingid binsrc mess unmess newsarts newsctl
  	newsbin newsumask newsmaster newsconfig chown chboth chgrp unixkind
! 	addrsize dbmopt faststdio storeval faststrchr sete ranlib
  	symdef cc copts ldopts postlibs hostname uname uucptype dftype dfdirs
  	archive spacelow nfsgroup server manpages manmess rbin doui bin atok
***************
*** 10,13 ****
--- 10,15 ----
  	postdefltdist paranoid whoami mailname organization postdefltgroup
  	newspath fake fakehdrs'
+ # where to remember them, by default
+ memory=build.def
  
  # functions and headers we are prepared to fake
***************
*** 14,18 ****
  mightfake='fsync getopt memcpy memcmp memchr memset mkdir
  	putenv strchr strrchr strpbrk strspn strcspn strtok symlink'
! mightfakehdrs='stdlib.h string.h'
  
  # directories in which to do makes
--- 16,20 ----
  mightfake='fsync getopt memcpy memcmp memchr memset mkdir
  	putenv strchr strrchr strpbrk strspn strcspn strtok symlink'
! mightfakehdrs='string.h'
  
  # directories in which to do makes
***************
*** 39,43 ****
  chmod +x ask yesno notinlist	# just in case
  
! if test -r build.def
  then
  	echo
--- 41,49 ----
  chmod +x ask yesno notinlist	# just in case
  
! case $# in
! 0)	;;
! *)	memory="$1"	;;
! esac
! if test -r $memory
  then
  	echo
***************
*** 46,50 ****
  	yes)	echo
  		echo 'Picking up defaults, from last run...'
! 		. build.def
  		echo 'done'
  		;;
--- 52,56 ----
  	yes)	echo
  		echo 'Picking up defaults, from last run...'
! 		. $memory
  		echo 'done'
  		;;
***************
*** 212,230 ****
  	lb=
  	case "$unmess" in
! 	yes)	echo "mkdir $realarts $realctl $realbin"
! 		if test " $realarts" != " $newsarts"
  		then
! 			echo "ln -s $realarts $newsarts"
! 			ln="$ln $realarts"
  		fi
! 		if test " $realctl" != " $newsctl"
  		then
! 			echo "ln -s $realctl $newsctl"
! 			ln="$ln $realctl"
  		fi
! 		if test " $realbin" != " $newsbin"
  		then
! 			echo "ln -s $realbin $newsbin"
! 			lb="$lb $realbin"
  		fi
  		;;
--- 218,236 ----
  	lb=
  	case "$unmess" in
! 	yes)	echo "mkdir $newsarts $newsctl $newsbin"
! 		if test " $linkarts" != " $newsarts"
  		then
! 			echo "ln -s $newsarts $linkarts"
! 			ln="$ln $linkarts"
  		fi
! 		if test " $linkctl" != " $newsctl"
  		then
! 			echo "ln -s $newsctl $linkctl"
! 			ln="$ln $linkctl"
  		fi
! 		if test " $linkbin" != " $newsbin"
  		then
! 			echo "ln -s $newsbin $linkbin"
! 			lb="$lb $linkbin"
  		fi
  		;;
***************
*** 297,305 ****
  	esac
  done
- has=`notinlist "$fake" ldiv.o`
- tmp=`yesno 'Does your system have a library function ldiv() as in ANSI C' $has`
- case "$tmp" in
- no)	newfake="$newfake ldiv.o"	;;
- esac
  has=`notinlist "$fake" dbm.o`
  tmp=`yesno 'Does your system have the "dbm" library' $has`
--- 303,306 ----
***************
*** 386,403 ****
  
  echo
- echo 'Some old systems think sprintf() returns a value of type "char *".'
- echo 'The modern standard is that it returns "int".  Does your sprintf()'
- sprintfchar=`yesno 'return "char *"' ${sprintfchar-no}`
- case "$sprintfchar" in
- yes)	echo 'You may have to hand-edit our "libc.h" include file if'
- 	echo 'your compiler objects to us declaring sprintf() to'
- 	echo 'return "int".  (This will usually happen only if your'
- 	echo '<stdio.h> header file declares sprintf() -- some do,'
- 	echo 'some do not.)  If you do need to edit "libc.h", look'
- 	echo 'for the definition of "sprvalue".'
- 	;;
- esac
- 
- echo
  echo 'Very old Unix systems needed the order of object modules in a library'
  echo 'chosen very carefully.  V7 introduced "ranlib" which removes the need'
--- 387,390 ----
***************
*** 477,481 ****
  echo '	bsd	4.2BSD and later'
  echo '	sysv	many System Vs'
! echo '	xenix	some (all?) Xenixes, notably SCO; also Microport?'
  echo '	sgi	Silicon Graphics Iris systems'
  echo '	ultrix	DEC Ultrix 3.0 (and later) (and earlier??)'
--- 464,468 ----
  echo '	bsd	4.2BSD and later'
  echo '	sysv	many System Vs'
! echo '	xenix	some (all?) Xenixes; some System Vs, e.g. Microport, HP?'
  echo '	sgi	Silicon Graphics Iris systems'
  echo '	ultrix	DEC Ultrix 3.0 (and later) (and earlier??)'
***************
*** 502,506 ****
  echo 'name of a device.  Modern ones can be given any directory name and'
  echo 'the system handles the details of figuring out what device is meant.'
! dfdirs=`yesno 'Will your "df" accept a directory-name argument' ${dfdirs-yes}`
  case "$dfdirs" in
  no)	echo 'You are going to have to customize "spacefor" for your system.'
--- 489,494 ----
  echo 'name of a device.  Modern ones can be given any directory name and'
  echo 'the system handles the details of figuring out what device is meant.'
! echo 'A few will take a directory only if it is the "top" of a filesystem.'
! dfdirs=`yesno 'Will "df" accept any directory name as an argument' ${dfdirs-yes}`
  case "$dfdirs" in
  no)	echo 'You are going to have to customize "spacefor" for your system.'
***************
*** 535,539 ****
  echo 'Are you running C News on a group of machines hooked together with NFS,'
  nfsgroup=`yesno 'with articles filed on one "server" machine' ${nfsgroup-no}`
- server=
  case "$nfsgroup" in
  yes)	case "$hostname$uname" in
--- 523,526 ----
***************
*** 978,985 ****
  echo
  echo 'saving defaults...'
! rm -f build.def
! >build.def
  warn='# These answers are interdependent; do not edit this file!'
! if test ! -w build.def
  then
  	echo 'It appears that I cannot save the defaults.'
--- 965,972 ----
  echo
  echo 'saving defaults...'
! rm -f $memory
! >$memory
  warn='# These answers are interdependent; do not edit this file!'
! if test ! -w $memory
  then
  	echo 'It appears that I cannot save the defaults.'
***************
*** 991,998 ****
  			eval "echo $v=\\\"\$$v\\\""
  		done
! 	) >>build.def
  	echo 'done'
  fi
! chmod -w build.def
  
  echo
--- 978,985 ----
  			eval "echo $v=\\\"\$$v\\\""
  		done
! 	) >>$memory
  	echo 'done'
  fi
! chmod -w $memory
  
  echo

*** cnpatch/old/conf/subst	Tue Jan 16 17:58:28 1990
--- conf/subst	Sat Feb 10 19:53:16 1990
***************
*** 36,40 ****
  		;;
  	esac
! 	echo "$f:"
  
  	# test existences
--- 36,40 ----
  		;;
  	esac
! 	echo "$f: " | tr -d '\012'
  
  	# test existences
***************
*** 77,80 ****
--- 77,81 ----
  	then
  		rm -f $new $old
+ 		echo "unchanged"
  	else
  		trap "mv $old $f; exit" 1 2 15
***************
*** 83,86 ****
--- 84,88 ----
  		trap "rm -f $old; exit" 1 2 15
  		rm $old
+ 		echo "updated"
  	fi
  done

*** cnpatch/old/expire/README	Wed Jan 10 19:10:22 1990
--- expire/README	Sat Jan 27 21:57:01 1990
***************
*** 1,10 ****
  C News expire
  
! Unlike the old alpha C News expire, this one will accept B News history
  files... although that slows it down, and this hasn't been tested well.
  Beware that the date in the middle field of the history line must be
! readable to getdate(3), and rumor hath it that late B 2.11 dates are not.
! Talk about stupid...  We don't care enough to do anything about this.
  Rebuilding your history file in C News format is preferable anyway.
  
  It WON'T accept the old experimental C News four-field history files;
--- 1,10 ----
  C News expire
  
! Unlike the old alpha C News expire, this one will accept old B News history
  files... although that slows it down, and this hasn't been tested well.
  Beware that the date in the middle field of the history line must be
! readable to getdate(3), and rumor hath it that mid-B2.11 dates are not.
  Rebuilding your history file in C News format is preferable anyway.
+ Current releases of B News use C News format, in fact.
  
  It WON'T accept the old experimental C News four-field history files;

*** cnpatch/old/expire/dircheck	Fri Jun 23 14:45:45 1989
--- expire/dircheck	Tue Mar  6 13:42:58 1990
***************
*** 6,10 ****
  esac
  
! for f in `sed 's/.*	//;s/\./\//g'`
  do
  	if test " $invert" = " "
--- 6,10 ----
  esac
  
! for f in `sed 's/.*	//;s:\.:/:g'`
  do
  	if test " $invert" = " "

*** cnpatch/old/expire/doexpire	Thu Aug 24 16:39:49 1989
--- expire/doexpire	Sat Feb 17 19:27:24 1990
***************
*** 40,45 ****
  if test " $ropt" = " -r"
  then
! 	echo "$0: short of space for temporaries, resorting to \`expire -r'" |
! 							mail "$NEWSMASTER"
  fi
  
--- 40,51 ----
  if test " $ropt" = " -r"
  then
! 	(
! 		echo "$0:"
! 		echo "	SEVERE SPACE SHORTAGE in $NEWSCTL !"
! 		echo "	Unable to rebuild history files due to insufficient"
! 		echo "	space for temporaries -- resorting to \`expire -r'."
! 		echo "	Growth of the history files will make things worse;"
! 		echo "	if shortage persists, human action is urgently needed."
! 	) | mail "$NEWSMASTER"
  fi
  

*** cnpatch/old/expire/expire.c	Wed Jan 10 19:10:24 1990
--- expire/expire.c	Fri Feb 23 15:15:32 1990
***************
*** 1168,1171 ****
--- 1168,1173 ----
  char *s2;
  {
+ 	int saveerr = errno;
+ 
  	if (spacetight) {
  		cd(ctlfile((char *)NULL));
***************
*** 1174,1177 ****
--- 1176,1180 ----
  		(void) unlink("history.n.pag");
  	}
+ 	errno = saveerr;
  	errunlock(s1, s2);
  	/* NOTREACHED */

*** cnpatch/old/h/libc.h	Mon Nov 13 17:39:44 1989
--- h/libc.h	Thu Feb  8 15:01:17 1990
***************
*** 1,3 ****
- 
  #ifndef LIBC_H
  #define LIBC_H
--- 1,2 ----
***************
*** 55,66 ****
  #endif					/* A_STABLE_WORLD */
  extern FILE *popen();			/* stdio.h */
! #ifdef __STDC__
! extern int printf(char *fmt, ...);	/* stdio.h */
! extern int fprintf(FILE *fp, char *fmt, ...);		/* stdio.h */
! extern sprvalue sprintf(char *buf, char *fmt, ...);	/* stdio.h */
! #else					/* __STDC__ */
! extern int printf(), fprintf();		/* stdio.h */
! extern sprvalue sprintf();		/* stdio.h */
! #endif					/* __STDC__ */
  
  /* these unfortunately cannot be relied upon to be in the right header */
--- 54,58 ----
  #endif					/* A_STABLE_WORLD */
  extern FILE *popen();			/* stdio.h */
! /* stdio.h is supposed to declare *printf */
  
  /* these unfortunately cannot be relied upon to be in the right header */

*** cnpatch/old/h/news.h	Mon Nov 13 17:39:44 1989
--- h/news.h	Mon Mar  5 13:41:55 1990
***************
*** 71,75 ****
  /* STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0 */
  #define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0)
! #define STRLEN(s) (sizeof (s) - 1)	/* s must be a char array */
  #ifdef FASTSTRCHR
  #define STRCHR(src, chr, dest) (dest) = strchr(src, chr)
--- 71,75 ----
  /* STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0 */
  #define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0)
! #define STRLEN(s) ((unsigned)sizeof(s) - 1)	/* s must be a char array */
  #ifdef FASTSTRCHR
  #define STRCHR(src, chr, dest) (dest) = strchr(src, chr)
***************
*** 87,90 ****
--- 87,91 ----
  #define nnafree(mempp) (*(mempp) != 0? (free((char *)*(mempp)), (*(mempp) = 0)): 0)
  #ifdef lint
+ static
  nnfree(mempp)		/* If *mempp is non-null, free it and zero it. */
  register char **mempp;			/* pointer to malloc'ed ptr. */

*** cnpatch/old/hfake/Makefile	Wed Jan 10 19:10:30 1990
--- hfake/Makefile	Fri Mar  9 14:12:39 1990
***************
*** 2,11 ****
  
  # beware -- build knows about NEEDED
! NEEDED =  ../include/stdlib.h ../include/string.h
  
  all:	$(NEEDED)
  
- $(I)/stdlib.h:	stdlib.h
- 	cp stdlib.h $@
  $(I)/string.h:	string.h
  	cp string.h $@
--- 2,9 ----
  
  # beware -- build knows about NEEDED
! NEEDED =  ../include/string.h
  
  all:	$(NEEDED)
  
  $(I)/string.h:	string.h
  	cp string.h $@

*** cnpatch/old/input/newsrun	Wed Jan 10 19:10:33 1990
--- input/newsrun	Thu Mar  8 12:20:53 1990
***************
*** 139,143 ****
  				mv $f $bad	# Not $text, save the ORIGINAL!
  			fi
! 			echo "$server relaynews \`$bad' failed, status $st" |
  							mail "$NEWSMASTER"
  		fi
--- 139,143 ----
  				mv $f $bad	# Not $text, save the ORIGINAL!
  			fi
! 			echo "$server relaynews \`$bad' failed, status $st (see errlog)" |
  							mail "$NEWSMASTER"
  		fi

*** cnpatch/old/libcnews/ltoza.c	Tue Jun 20 18:59:10 1989
--- libcnews/ltoza.c	Sat Feb 10 18:50:46 1990
***************
*** 6,10 ****
   * with printf on V7, due to a bug in V7's printf.
   */
- #include <stdlib.h>
  
  #define RADIX 10
--- 6,9 ----
***************
*** 32,40 ****
  	op += wwid - 1;			/* find right end */
  	while (wwid-- > 0) {		/* generate "wwid" digits */
! 		register ldiv_t result;
! 
! 		result = ldiv(wval, (long)RADIX);	/* shades of V6! */
! 		wval = result.quot;
! 		*op-- = result.rem + '0';
  	}
  	return wval == 0;
--- 31,36 ----
  	op += wwid - 1;			/* find right end */
  	while (wwid-- > 0) {		/* generate "wwid" digits */
! 		*op-- = wval % RADIX + '0';
! 		wval /= RADIX;
  	}
  	return wval == 0;

*** cnpatch/old/libcnews/ngmatch.c	Thu Aug 24 16:39:54 1989
--- libcnews/ngmatch.c	Wed Mar  7 13:45:05 1990
***************
*** 9,24 ****
   *	word: { alphanum }+ | "all"
   *
!  * Only one group need match for success.  (Redundant?)
   *
   * For each group, note the depth of each match against the patterns,
!  * negated or not.  Ignore mismatches.  The deepest match wins at the end;
!  * if it's a tie, negated matches are rejections.
   *
-  * A match of any group against the patterns is a success.
-  * Failure to match any pattern with a group is a mismatch of that group.
-  * Failure to match any group against any pattern is a total failure.
-  *
   * "all" in a pattern is a wildcard that matches exactly one word;
!  * it does not cross "." (NGDELIM) delimiters.
   */
  
--- 9,26 ----
   *	word: { alphanum }+ | "all"
   *
!  * Only one group need match for success.
!  * Failure to match any pattern with a group is a mismatch of that group only.
!  * Failure to match any group against any pattern is a total failure.
   *
   * For each group, note the depth of each match against the patterns,
!  * negated or not.  Ignore mismatches.  The deepest match wins at the
!  * end:  a deeper negated match is a failure, a deeper plain match is a
!  * success; a tie is a failure, but see the description of wildcards.
   *
   * "all" in a pattern is a wildcard that matches exactly one word;
!  * it does not cross "." (NGDELIM) delimiters.  A non-wildcard match is
!  * considered to have matched slightly deeper than a wildcard match in the
!  * same position.  This ensures that !alt.sex.all,alt.sex.bondage matches
!  * alt.sex.bondage.
   */
  
***************
*** 106,114 ****
  			;			/* ignore it */
  		else if (negation) {
! 			/* record ordinal # of deepest negated matched word */
  			if (depth > faildeepest)
  				faildeepest = depth;
  		} else {
! 			/* record ordinal # of deepest plain matched word */
  			if (depth > hitdeepest)
  				hitdeepest = depth;
--- 108,116 ----
  			;			/* ignore it */
  		else if (negation) {
! 			/* record depth of deepest negated matched word */
  			if (depth > faildeepest)
  				faildeepest = depth;
  		} else {
! 			/* record depth of deepest plain matched word */
  			if (depth > hitdeepest)
  				hitdeepest = depth;
***************
*** 124,130 ****
   * Match a pattern against a group by looking at each word of pattern in turn.
   *
!  * On a match, return the ordinal number of the rightmost word that matches.
!  * If group runs out first, the match fails; else it succeeds.
!  * On a failure, return zero.
   */
  STATIC int
--- 126,132 ----
   * Match a pattern against a group by looking at each word of pattern in turn.
   *
!  * On a match, return the depth (roughly, ordinal number * k) of the rightmost
!  * word that matches.  If group runs out first, the match fails; if pattern
!  * runs out first, it succeeds.  On a failure, return zero.
   */
  STATIC int
***************
*** 138,143 ****
  
  	for (patwd = patp, grwd = grp; patwd != NULL && grwd != NULL;
! 	    patwd = patdot, grwd = grdot, depth++) {
! 		register boolean match;
  
  	    	/* null-terminate words */
--- 140,146 ----
  
  	for (patwd = patp, grwd = grp; patwd != NULL && grwd != NULL;
! 	    patwd = patdot, grwd = grdot) {
! 		register boolean match = NO;
! 		register int incr = 20;
  
  	    	/* null-terminate words */
***************
*** 151,160 ****
  		/*
  		 * Match one word of pattern with one word of group.
! 		 * A pattern word of "all" matches any group word.
  		 */
  #ifdef FAST_STRCMP
! 		match = STREQ(patwd, grwd) || STREQ(patwd, ALL);
  #else
- 		match = NO;
  		for (rpatwd = patwd; *rpatwd == *grwd++; )
  			if (*rpatwd++ == '\0') {
--- 154,167 ----
  		/*
  		 * Match one word of pattern with one word of group.
! 		 * A pattern word of "all" matches any group word,
! 		 * but isn't worth as much.
  		 */
  #ifdef FAST_STRCMP
! 		match = STREQ(patwd, grwd);
! 		if (!match && STREQ(patwd, ALL)) {
! 			match = YES;
! 			--incr;
! 		}
  #else
  		for (rpatwd = patwd; *rpatwd == *grwd++; )
  			if (*rpatwd++ == '\0') {
***************
*** 165,170 ****
  			/* ugly special case match for "all" */
  			rpatwd = patwd;
! 			match = *rpatwd++ == 'a' && *rpatwd++ == 'l' &&
! 			        *rpatwd++ == 'l' && *rpatwd   == '\0';
  		}
  #endif				/* FAST_STRCMP */
--- 172,180 ----
  			/* ugly special case match for "all" */
  			rpatwd = patwd;
! 			if (*rpatwd++ == 'a' && *rpatwd++ == 'l' &&
! 			    *rpatwd++ == 'l' && *rpatwd   == '\0') {
! 				match = YES;
! 				--incr;
! 			}
  		}
  #endif				/* FAST_STRCMP */
***************
*** 178,181 ****
--- 188,192 ----
  			break;
  		}
+ 		depth += incr;
  	}
  	/* if group name ran out before pattern, then match fails */

*** cnpatch/old/libcnews/strsave.c	Tue Jun 20 18:59:17 1989
--- libcnews/strsave.c	Mon Mar  5 13:41:56 1990
***************
*** 17,21 ****
  register char *s;
  {
! 	register char *news =nemalloc((unsigned)strlen(s)+1); /* include NUL */
  
  	(void) strcpy(news, s);
--- 17,21 ----
  register char *s;
  {
! 	register char *news = nemalloc((unsigned)strlen(s) + SIZENUL);
  
  	(void) strcpy(news, s);

*** cnpatch/old/libcnews/time.c	Tue Jun 20 18:59:07 1989
--- libcnews/time.c	Mon Mar  5 13:42:00 1990
***************
*** 19,23 ****
  {
  	struct timeb ftnow;
! 	char ms[4];				/* room for "123" and a NUL */
  
  	ftime(&ftnow);
--- 19,23 ----
  {
  	struct timeb ftnow;
! 	char ms[STRLEN("123") + SIZENUL];
  
  	ftime(&ftnow);

*** cnpatch/old/libfake/Makefile	Wed Jan 10 19:10:37 1990
--- libfake/Makefile	Fri Mar  9 14:13:14 1990
***************
*** 5,9 ****
  SHELL = /bin/sh
  
! ALL = dbm.o fsync.o getopt.o ldiv.o memchr.o memcmp.o memcpy.o \
  memset.o mkdir.o putenv.o strchr.o strcspn.o strpbrk.o strrchr.o \
  strspn.o strtok.o symlink.o dbmclose.o
--- 5,9 ----
  SHELL = /bin/sh
  
! ALL = dbm.o fsync.o getopt.o memchr.o memcmp.o memcpy.o \
  memset.o mkdir.o putenv.o strchr.o strcspn.o strpbrk.o strrchr.o \
  strspn.o strtok.o symlink.o dbmclose.o
***************
*** 10,14 ****
  
  # beware -- build knows about NEEDED
! NEEDED =  ldiv.o
  
  u:	$(NEEDED)
--- 10,14 ----
  
  # beware -- build knows about NEEDED
! NEEDED = 
  
  u:	$(NEEDED)
***************
*** 18,23 ****
  
  try:	$(ALL)
- 
- # ldiv.o:	$(INCLUDE)/stdlib.h	# trouble if stdlib.h isn't ours
  
  clean:
--- 18,21 ----

*** cnpatch/old/libfake/README	Tue Jun 20 18:59:22 1989
--- libfake/README	Sat Feb 10 19:40:25 1990
***************
*** 8,14 ****
  Fsync and symlink are C-News-specific fakes.
  
- Ldiv.c is inefficient but provides the full ANSI C functionality.  (Do not
- confuse it with the prehistoric ldiv function found in some very old Unixes.)
- 
  The mem* and str* and *index functions come from Henry Spencer's public-domain
  string-functions implementation.  Said implementation is somewhat in need of
--- 8,11 ----

*** cnpatch/old/libstdio/LEGAL.STDIO	Tue Jun 20 18:59:38 1989
--- libstdio/LEGAL.STDIO	Mon Mar  5 13:42:00 1990
***************
*** 1,3 ****
! Page 165 of The C Programming Language describes some of the workings
! of the UNIX stdio implementation. In particular, it describes the
! function of _ptr and _cnt.
--- 1,7 ----
! Page 165 of The C Programming Language, 1st ed. describes some of the
! workings of the UNIX stdio implementation.  In particular, it describes
! the function of _ptr and _cnt.
! 
! Section 8 of The C Programming Language, 2nd ed. provides more detail.
! In particular, page 176 publishes a stdio.h, likely derived from some
! UNIX version.

*** cnpatch/old/man/expire.8	Tue Jan 16 17:58:29 1990
--- man/expire.8	Thu Mar  8 18:30:54 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH EXPIRE 8 "12 Jan 1990" "C News"
  .SH NAME
  expire, doexpire \- expire old news
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH EXPIRE 8 "12 Jan 1990"
! .BY "C News"
  .SH NAME
  expire, doexpire \- expire old news

*** cnpatch/old/man/inews.1	Thu Sep 14 16:03:41 1989
--- man/inews.1	Thu Mar  8 18:31:05 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH INEWS 1 "29 Aug 1989" "C News"
  .SH NAME
  inews \- `user-friendly' news-posting front-end for relaynews
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH INEWS 1 "29 Aug 1989"
! .BY "C News"
  .SH NAME
  inews \- `user-friendly' news-posting front-end for relaynews

*** cnpatch/old/man/news.5	Tue Jun 20 18:59:58 1989
--- man/news.5	Sun Mar 11 01:54:56 1990
***************
*** 25,29 ****
  .LP
  ..
! .TH NEWS 5 "8 June 1989" "C News"
  .SH NAME
  news \- USENET network news articles, batches, related files
--- 25,30 ----
  .LP
  ..
! .TH NEWS 5 "9 March 1990"
! .BY "C News"
  .SH NAME
  news \- USENET network news articles, batches, related files
***************
*** 110,114 ****
  Expires: Saturday, 1 Jan 83 00:00:00 EST
  Organization: Bell Labs, Murray Hill
! 
  The body of the article comes here, after a blank line.
  .Ee
--- 111,115 ----
  Expires: Saturday, 1 Jan 83 00:00:00 EST
  Organization: Bell Labs, Murray Hill
! .sp 0.3
  The body of the article comes here, after a blank line.
  .Ee
***************
*** 193,204 ****
  headers to avoid sending an article back
  to a site that has seen it.
- The special name
- .B ME
- stands for the name of the machine news is running on,
- as determined by some operating-system dependent means
- such as
- .IR hostname (2)
- or
- .IR uname (2).
  The
  .IR exclusion s
--- 194,197 ----
***************
*** 210,237 ****
  .IR exclusions .
  .PP
! The
  .I subscriptions
! is the list of newsgroups to be transmitted to the
! .IR system
! (or received if
! .I system
! is the current site);
! they are matched against the
  .B Newsgroups:
  header of each article
! and any matching articles are transmitted:
  .B all
! matches any single word,
! stopping at periods and commas;
! .B comp
! also implies
! .BR comp.all ,
! recursively;
! .B !talk
! .I mismatches
! all the
! .B talk
! groups;
! order is unimportant;
  .B comp,comp.sys.sun,!comp.sys
  matches all the
--- 203,291 ----
  .IR exclusions .
  .PP
! The special
! .I system name
! .B ME
! stands for the name of the machine news is running on,
! as determined from
! .IR \*c/whoami .
! (The
! .B ME
! line,
! or a line whose
! .I system name
! is explicitly that of the machine news is running on,
! has a rather different meaning from that of the other
! .I sys
! file lines:
! its
  .I subscriptions
! subfield
! identifies
! the newsgroups that this site subscribes to (i.e. is willing to receive),
! and its other fields and subfields are ignored.)
! .PP
! .I subscriptions
! is a comma-separated list of
! .I "newsgroup patterns"
! specifying the newsgroups
! to be transmitted to the
! .IR system ;
! each newsgroup from the
  .B Newsgroups:
  header of each article
! is matched against the pattern list,
! and if any newsgroup matches the pattern list,
! the article is transmitted.
! The rules for matching a newsgroup against a single pattern are:
! .IP \(bu "\w'\(bu  'u"
! .IR word s
! in a newsgroup or a pattern
! are delimited by periods;
! .IP \(bu
! words of a pattern and a newsgroup
! match only if they are identical,
! except that
! the word
  .B all
! in a pattern
! matches any newsgroup word;
! .IP \(bu
! a newsgroup is matched against a pattern word by word, and all words
! must match for the newsgroup to match that pattern;
! .IP \(bu
! if the pattern has fewer words than the newsgroup, the pattern is implicitly
! extended to the same number of words by appending
! .B \&.all
! as many times as necessary;
! .IP \(bu
! if the newsgroup has fewer words than the pattern, the newsgroup does not
! match the pattern;
! .IP \(bu
! if
! .I pattern
! matches a newsgroup,
! .BI ! pattern
! .IR mis matches
! that newsgroup.
! .LP
! A newsgroup matches a pattern list if, and only if, it matches at least
! one of the patterns and:
! .IP \(bu "\w'\(bu  'u"
! the newsgroup
! does not mismatch any of the patterns, or
! .IP \(bu
! the longest matched pattern is longer than the longest mismatched
! pattern
! (length is measured in number of words,
! with each explicit occurrence of
! .B all
! counted as slightly less than one word,
! and does not include
! the implicit extension of patterns with
! .BR \&.all ).
! .LP
! Note that order in the lists is not significant,
! and that ties are broken in favor of not matching.
! An example:
  .B comp,comp.sys.sun,!comp.sys
  matches all the
***************
*** 244,263 ****
  .I "but including"
  .BR comp.sys.sun .
  The
! .I distributions
! are matched similarly with the
  .B Distribution:
! header,
! but only when sending articles;
! .I distributions
! do not affect receipt of articles.
  If no
  .I distributions
  are supplied,
  the
  .I subscriptions
- will be matched against
- .B Distribution:
  instead.
  .PP
  The
--- 298,320 ----
  .I "but including"
  .BR comp.sys.sun .
+ .PP
  The
! distributions in the
  .B Distribution:
! header
! are similarly matched against the
! .IR distributions .
  If no
  .I distributions
  are supplied,
+ .B Distribution:
+ will be matched against
  the
  .I subscriptions
  instead.
+ (The
+ .B Distribution:
+ header is ignored when receiving news;
+ it is only significant when sending.)
  .PP
  The
***************
*** 300,306 ****
  to be transmitted as the standard input.
  The default is
! .RI "`uux \- \-z \-r " sysname !rnews'
  for a command;
! the PATH searched includes \*b/relay,
  so that the commands described in \fInewsmail\fR(8)
  are available as alternatives to \fIuux\fR.
--- 357,366 ----
  to be transmitted as the standard input.
  The default is
! `\c
! .BI "uux \- \-z \-r " sysname !rnews\c
! \&'
  for a command;
! the PATH searched includes
! .BR \*b/relay ,
  so that the commands described in \fInewsmail\fR(8)
  are available as alternatives to \fIuux\fR.
***************
*** 308,315 ****
  this field to be taken as a filename,
  the default is
! .RI \*a/out.going/ sysname /togo;
  if a filename is given but it does not start with `/', it is assumed
  to be relative to the
! \*a/out.going
  directory.
  .LP
--- 368,376 ----
  this field to be taken as a filename,
  the default is
! .BI \*a/out.going/ sysname /togo\c
! ;
  if a filename is given but it does not start with `/', it is assumed
  to be relative to the
! .B \*a/out.going
  directory.
  .LP
***************
*** 318,334 ****
  # line indicating what we are willing to receive; note local groups on end
  ME:comp,news,sci,rec,misc,soc,talk,to,can,ont,tor,ut
! 
  # sample insignificant feed not using batching
  huey:news.config,to.huey/all::uux - -r -gd huey!rnews
! 
  # sample major batched feed, including (unnecessary) explicit file name
  dewey:comp,news,sci,rec,misc,soc,talk,to.dewey,can,ont,tor,ut/all:f:dewey/togo
! 
  # sample long-haul feed; note no local groups
  donald:comp,news,sci,rec,misc,soc,talk,to.donald/all:f:
! 
  # sample local-postings-only feed direct to major site (gets them out fast)
  scrooge:comp,news,sci,rec,misc,soc,talk,to.scrooge/all:Lf:
! 
  # sample ihave/sendme link
  # Send ihave telling louie what we have -- batcher turns the batch into a
--- 379,395 ----
  # line indicating what we are willing to receive; note local groups on end
  ME:comp,news,sci,rec,misc,soc,talk,to,can,ont,tor,ut
! .sp 0.3
  # sample insignificant feed not using batching
  huey:news.config,to.huey/all::uux - -r -gd huey!rnews
! .sp 0.3
  # sample major batched feed, including (unnecessary) explicit file name
  dewey:comp,news,sci,rec,misc,soc,talk,to.dewey,can,ont,tor,ut/all:f:dewey/togo
! .sp 0.3
  # sample long-haul feed; note no local groups
  donald:comp,news,sci,rec,misc,soc,talk,to.donald/all:f:
! .sp 0.3
  # sample local-postings-only feed direct to major site (gets them out fast)
  scrooge:comp,news,sci,rec,misc,soc,talk,to.scrooge/all:Lf:
! .sp 0.3
  # sample ihave/sendme link
  # Send ihave telling louie what we have -- batcher turns the batch into a

*** cnpatch/old/man/newsaux.8	Tue Jan 16 17:58:30 1990
--- man/newsaux.8	Thu Mar  8 18:31:33 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSAUX 8 "13 Jan 1990" "C News"
  .SH NAME
  spacefor \- check available space for news
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSAUX 8 "13 Jan 1990"
! .BY "C News"
  .SH NAME
  spacefor \- check available space for news

*** cnpatch/old/man/newsbatch.8	Tue Jan 16 17:58:31 1990
--- man/newsbatch.8	Thu Mar  8 18:31:45 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSBATCH 8 "13 Jan 1990" "C News"
  .SH NAME
  sendbatches, batchsplit \- news batching to other sites
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSBATCH 8 "13 Jan 1990"
! .BY "C News"
  .SH NAME
  sendbatches, batchsplit \- news batching to other sites

*** cnpatch/old/man/newsmail.8	Fri Jun 23 14:45:48 1989
--- man/newsmail.8	Thu Mar  8 18:31:55 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSMAIL 8 "22 June 1989" "C News"
  .SH NAME
  mailnews, sendnews \- send unbatched news as mail
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSMAIL 8 "22 June 1989"
! .BY "C News"
  .SH NAME
  mailnews, sendnews \- send unbatched news as mail

*** cnpatch/old/man/newsmaint.8	Tue Jan 16 17:58:24 1990
--- man/newsmaint.8	Thu Mar  8 18:32:05 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSMAINT 8 "16 Jan 1990" "C News"
  .SH NAME
  newshist \- extract history line for news article(s)
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH NEWSMAINT 8 "16 Jan 1990"
! .BY "C News"
  .SH NAME
  newshist \- extract history line for news article(s)

*** cnpatch/old/man/postnews.1	Tue Jun 20 18:59:54 1989
--- man/postnews.1	Thu Mar  8 18:32:15 1990
***************
*** 1,5 ****
  .\" =()<.ds c @<NEWSCTL>@>()=
  .ds c /usr/lib/news
! .TH POSTNEWS 1 "9 June 1989" "C News"
  .SH NAME
  postnews \- simple interactive news-posting interface
--- 1,6 ----
  .\" =()<.ds c @<NEWSCTL>@>()=
  .ds c /usr/lib/news
! .TH POSTNEWS 1 "9 June 1989"
! .BY "C News"
  .SH NAME
  postnews \- simple interactive news-posting interface

*** cnpatch/old/man/relaynews.8	Wed Jan 10 19:10:46 1990
--- man/relaynews.8	Mon Mar 12 13:35:23 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH RELAYNEWS 8 "2 January 1990" "C News"
  .SH NAME
  relaynews \- store and forward netnews articles
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH RELAYNEWS 8 "2 January 1990"
! .BY "C News"
  .SH NAME
  relaynews \- store and forward netnews articles
***************
*** 231,234 ****
--- 232,252 ----
  .B news/include/news.h
  for the bit definitions.
+ .br
+ If
+ .I relaynews
+ cannot establish safe
+ standard file descriptors
+ and
+ standardise its environment
+ (notably PATH,
+ SHELL
+ and IFS),
+ probably due to failure of
+ .IR malloc (3),
+ it will exit with status of 1
+ and without writing any complaints on standard error
+ (\c
+ .BR errlog ),
+ as a security precaution.
  .SH HISTORY
  Written by Geoff Collyer

*** cnpatch/old/man/rnews.8	Mon Nov 13 17:39:47 1989
--- man/rnews.8	Thu Mar  8 18:32:37 1990
***************
*** 7,11 ****
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH RNEWS 8 "3 Nov 1989" "C News"
  .SH NAME
  rnews, cunbatch \- accept and spool news input
--- 7,12 ----
  .\" =()<.ds m @<NEWSMASTER>@>()=
  .ds m usenet
! .TH RNEWS 8 "3 Nov 1989"
! .BY "C News"
  .SH NAME
  rnews, cunbatch \- accept and spool news input

*** cnpatch/old/misc/Makefile	Wed Jan 10 19:10:47 1990
--- misc/Makefile	Sat Feb 24 20:00:30 1990
***************
*** 12,16 ****
  
  MAINTBIN=newshist
! MAINT = $(MAINTBIN) newsdaily newswatch newsboot locknews addgroup delgroup adddirs
  UTILBIN = gngp newslock ctime getdate canonhdr
  UTILS = $(UTILBIN) sizeof newshostname
--- 12,16 ----
  
  MAINTBIN=newshist
! MAINT = $(MAINTBIN) newsdaily newswatch newsboot locknews addgroup delgroup adddirs addfeed
  UTILBIN = gngp newslock ctime getdate canonhdr
  UTILS = $(UTILBIN) sizeof newshostname

*** cnpatch/old/misc/canonhdr.c	Thu Sep 14 16:03:25 1989
--- misc/canonhdr.c	Mon Mar  5 13:42:01 1990
***************
*** 82,87 ****
  				if (isascii(*cp) && isupper(*cp))
  					*cp = tolower(*cp);
! 		if (STREQN(hdr, canonmsgid, sizeof canonmsgid - 1))
! 			(void) strncpy(hdr, magicmsgid, sizeof magicmsgid - 1);
  		(void) fputs(hdr, stdout);
  		/* must not free hdr; gethdr will do so automatically */
--- 82,87 ----
  				if (isascii(*cp) && isupper(*cp))
  					*cp = tolower(*cp);
! 		if (STREQN(hdr, canonmsgid, STRLEN(canonmsgid)))
! 			(void) strncpy(hdr, magicmsgid, STRLEN(magicmsgid));
  		(void) fputs(hdr, stdout);
  		/* must not free hdr; gethdr will do so automatically */

*** cnpatch/old/notebook/problems	Tue Jan 16 17:58:35 1990
--- notebook/problems	Fri Mar  9 14:11:03 1990
***************
*** 1,3 ****
! .DA "13 Jan 1990"
  .TL
  Known Porting Problems With C News
--- 1,3 ----
! .DA "8 March 1990"
  .TL
  Known Porting Problems With C News
***************
*** 113,117 ****
  to be problems with this macro.
  Some compilers,
! notably the one in Microport System V Release 2.3,
  reject it.
  We have heard a report that System V Release 2 on the VAX silently
--- 113,117 ----
  to be problems with this macro.
  Some compilers,
! notably the one in Microport System V for the 286,
  reject it.
  We have heard a report that System V Release 2 on the VAX silently
***************
*** 197,200 ****
--- 197,202 ----
  process a single article, not a batch.
  This happens primarily when an article is posted locally, with \fIinews\fR.)
+ It is still barely possible that the plausibility check will fail on some
+ bizarre system.
  .SH
  df Output Format
***************
*** 235,239 ****
  The only fix is to compile \fIdbz\fR without \fB\-O\fR.
  .SH
! HP Spectrum Optimizer vs. nnfree
  .PP
  We have a reliable report that
--- 237,241 ----
  The only fix is to compile \fIdbz\fR without \fB\-O\fR.
  .SH
! nnafree and nnfree
  .PP
  We have a reliable report that
***************
*** 242,246 ****
  ``cc: Internal error 3279: Please contact your local HP representative''
  message)
! on the \fInnfree\fR macro in \fIh/news.h\fR.
  The following revised version of
  the macro reportedly avoids
--- 244,250 ----
  ``cc: Internal error 3279: Please contact your local HP representative''
  message)
! on the \fInnafree\fR macro
! (and \fInnfree\fR, a historical synonym)
! in \fIh/news.h\fR.
  The following revised version of
  the macro reportedly avoids
***************
*** 250,253 ****
--- 254,267 ----
     *(mempp) = 0; }} while (0)
  .DE
+ .PP
+ It is also reliably reported that the Microport compiler objects to
+ these macros in large model.
+ Whether the above fix would suffice is not known.
+ Manual expansion [barf!] is known to work, although it would be less
+ painful to define a function containing the right code and change the
+ macro to call the function.
+ Code for a suitable function can, in fact, be found
+ in \fIh/news.h\fR,
+ inside `#ifdef\ lint'.
  .SH
  ANSI C
***************
*** 306,307 ****
--- 320,376 ----
  in two places, and the Makefile attempts a link before doing a copy),
  and substantially more in the regression tests.
+ .SH
+ 16-bit Machines
+ .PP
+ C News has been tested on 16-bit machines\(emindeed, a good bit of the
+ early development work was done on one\(emand does run on them.
+ Nothing relies on ints being 32 bits.
+ Nothing relies on pointers and ints being the same size, as far as we know.
+ Nothing relies on large address spaces,
+ although one or two modules come in separate small-space and large-space
+ versions, and the small-space versions are slower.
+ .PP
+ However, there are some fundamental limits
+ to consider.
+ Both \fIrelaynews\fR and \fIexpire\fR\(emthe usual trouble spots for
+ space shortages\(emwant to keep lots of stuff in core.
+ There isn't any easy way around this one.
+ .SH
+ Number of File Descriptors
+ .PP
+ There is a constant, NOPENBFS, in \fIrelay/trbatch.c\fR, that defines
+ how many batch files are kept open simultaneously.
+ If you are feeding much news to more systems than this,
+ \fIrelaynews\fR performance will suffer.
+ .PP
+ The major limit on NOPENBFS is available file descriptors
+ (although on a 16-bit machine there might also be a shortage of memory
+ for \fIstdio\fR buffers).
+ Other parts of \fIrelaynews\fR want perhaps 10 file descriptors for
+ other purposes, so with the usual total supply of 20, a NOPENBFS value
+ of 10 is the right default.
+ If you feed many people,
+ and your kernel provides a process with more than 20 file
+ descriptors,
+ you probably want to boost
+ NOPENBFS (this can be done with -DNOPENBFS=xxx in the makefile).
+ Remember to leave about 10 descriptors worth of headroom.
+ .SH
+ Shell Processing Order
+ .PP
+ Normally, shell
+ variable expansion should take place before scanning for syntax
+ elements such as ``0<&1''.
+ At least one reimplementation of the shell
+ (specifically, Bash 1.04) does things in the
+ wrong order.
+ This is known to affect, at least, \fIrelay/sh/anne.jones\fR,
+ which can be fixed by changing (circa line 44)
+ .DS
+ "")	USER="`who am i <&$fd |
+ .DE
+ to
+ .DS
+ "")	USER="`eval \e"who am i <&$fd\e" |
+ .DE
+ or so we are told.

*** cnpatch/old/relay/active.c	Thu Aug 24 16:39:58 1989
--- relay/active.c	Mon Mar  5 18:44:49 1990
***************
*** 142,145 ****
--- 142,146 ----
  
  	if (actfp != NULL) {
+ 		nnfree(&lnc.lnc_ng);
  		lnc.lnc_ng = lnc.lnc_line = NULL;
  		status |= actfsync(actfp);

*** cnpatch/old/relay/caches.c	Tue Jun 20 19:01:00 1989
--- relay/caches.c	Mon Mar  5 18:44:53 1990
***************
*** 8,22 ****
  #include "active.h"
  #include "caches.h"
  #include "transmit.h"
  
  statust
- loadcaches()				/* reload in-core caches from disk */
- {
- 	return actload();
- }
- 
- statust
  synccaches()				/* force in-core caches to disk */
  {
! 	return actsync() | trclose();
  }
--- 8,17 ----
  #include "active.h"
  #include "caches.h"
+ #include "history.h"
  #include "transmit.h"
  
  statust
  synccaches()				/* force in-core caches to disk */
  {
! 	return actsync() | trclose() | closehist();
  }

*** cnpatch/old/relay/control.c	Tue Jan 16 17:58:39 1990
--- relay/control.c	Mon Mar  5 18:44:55 1990
***************
*** 107,111 ****
  	if (deadpid == -1 || pid == -1 || wstatus != 0)
  		art->a_status |= ST_DROPPED;	/* admin got err.msg. by mail */
! 	art->a_status |= loadcaches();
  }
  
--- 107,111 ----
  	if (deadpid == -1 || pid == -1 || wstatus != 0)
  		art->a_status |= ST_DROPPED;	/* admin got err.msg. by mail */
! 	/* let lazy evaluation load the caches */
  }
  

*** cnpatch/old/relay/fileart.c	Tue Jan 16 17:58:40 1990
--- relay/fileart.c	Mon Mar  5 18:51:18 1990
***************
*** 341,345 ****
  			 * Moral: don't run Eunice on your PDP-11.
  			 */
! 			worked = symlink(art->a_tmpf, artname) == 0;
  	}
  	if (debug)
--- 341,345 ----
  			 * Moral: don't run Eunice on your PDP-11.
  			 */
! 			worked = symlink(fullartfile(art->a_tmpf), artname) == 0;
  	}
  	if (debug)

*** cnpatch/old/relay/hdrdefs.c	Wed Jan 10 19:10:55 1990
--- relay/hdrdefs.c	Thu Feb  8 15:01:45 1990
***************
*** 10,20 ****
  #include <stdio.h>
  #include <sys/types.h>
- #ifdef REALSTDC
- #include <stdlib.h>
- #endif				/* REALSTDC */
  #include "libc.h"
  #include "news.h"
  #include "headers.h"
! #include "hdrint.h"		/* may define "const" */
  
  #ifndef offsetof
--- 10,20 ----
  #include <stdio.h>
  #include <sys/types.h>
  #include "libc.h"
  #include "news.h"
  #include "headers.h"
! #include "hdrint.h"		/* may define "const" or REALSTDC */
! #ifdef REALSTDC
! #include <stdlib.h>		/* may define offsetof */
! #endif				/* REALSTDC */
  
  #ifndef offsetof

*** cnpatch/old/relay/history.c	Tue Jan 16 17:58:40 1990
--- relay/history.c	Mon Mar  5 18:44:56 1990
***************
*** 323,324 ****
--- 323,344 ----
  	(void) strcat(art->a_files, artnumstr);
  }
+ 
+ statust
+ closehist()
+ {
+ 	register statust status = ST_OKAY;
+ 
+ 	if (fp != NULL) {
+ 		/* dbmclose is only needed by dbz, to flush statistics to disk */
+ 		if (dbmclose() < 0) {
+ 			warning("error closing dbm history file", "");
+ 			status |= ST_DROPPED;
+ 		}
+ 		if (nfclose(fp) == EOF) {
+ 			warning("error closing history file", "");
+ 			status |= ST_DROPPED;
+ 		}
+ 		fp = NULL;		/* mark file closed */
+ 	}
+ 	return status;
+ }

*** cnpatch/old/relay/history.h	Tue Jun 20 19:01:21 1989
--- relay/history.h	Mon Mar  5 18:44:59 1990
***************
*** 2,6 ****
  extern char *findfiles(), *gethistory();
  extern boolean alreadyseen();
! extern statust fakehist();
  extern void history(), histupdfiles();
  
--- 2,6 ----
  extern char *findfiles(), *gethistory();
  extern boolean alreadyseen();
! extern statust fakehist(), closehist();
  extern void history(), histupdfiles();
  

*** cnpatch/old/relay/trbatch.c	Tue Jun 20 19:01:42 1989
--- relay/trbatch.c	Mon Mar  5 18:51:15 1990
***************
*** 39,43 ****
   * ensure that (name, ord) are mapped to a batchfile.
   *
!  * if an attempt to open the batchfile's stream fails, close a random
   * batchfile stream and retry the open.
   */
--- 39,43 ----
   * ensure that (name, ord) are mapped to a batchfile.
   *
!  * if an attempt to open the batchfile's stream fails, close an arbitrary
   * batchfile stream and retry the open.
   */
***************
*** 162,166 ****
  
  STATIC statust
! bfrclose()				/* close a random batchfile */
  {
  	register struct batchfile *bf;
--- 162,166 ----
  
  STATIC statust
! bfrclose()				/* close an arbitrary batchfile */
  {
  	register struct batchfile *bf;


end of patch 12-Mar-1990
-- 
MSDOS, abbrev:  Maybe SomeDay |     Henry Spencer at U of Toronto Zoology
an Operating System.          | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.sources.bugs mailing list