🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Havard Eidnes Fri, 23 Aug 1991 13:53
Re: advance warning of C News changes
#1328
Author: Havard Eidnes
Date: Fri, 23 Aug 1991 13:53
91 lines
3828 bytes
In article <1991Aug22.164742.2641@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>In article <1991Aug22.153659.11517@ugle.unit.no> he@spurv.runit.sintef.no (Havard Eidnes) writes:
>>... no change would be needed
>>for newsxd itself (given that nntpxmit was changed already).
>
>Nobody has changed nntpxmit; all the changes have been to the things that
>invoke it, like nntpsend.

Oops!  Sorry, folks.  As a compensation for my mis-information let me offer
the changes to nntpxmit to make it unnecessary to change newsxd or
nntpsend. (I cross my fingers I did this right...)  The changes have been
done in nntpxmit.c from the 1.5.10 version of the NNTP software, but it
applies successfully (albeit with a bit of "fuzz" from patch) to the
1.5.11 version.  The 1.5.10 version has been tested successfully on "my"
news server, a SunOS machine.  Note that I have not yet installed the
latest and greatest C News on this host, but I hand-edited a NNTP batch file 
to contain relative path names and nntpsend still worked like a charm.

- Havard

--------------------------------

*** /tmp/,RCSt1a24987	Fri Aug 23 15:25:01 1991
--- nntpxmit.c	Fri Aug 23 15:21:07 1991
***************
*** 134,137 ****
--- 134,140 ----
  char	*E_fopen = "fopen(%s, \"%s\"): %s";
  char	*E_unlk = "unlink(%s): %s";
+ char	*E_chdir = "chdir(%s): %s";
+ char	*E_getwd = "getwd: %s";
+ char	oldpath[1024];		/* Where we cd back in cleanup */
  
  ll_t	FailedArticles;		/* list of failed articles */
***************
*** 337,344 ****
  	char	*mode = "r";
  #endif	FTRUNCATE
  
  	if ((Qfp = fopen(file, mode)) == (FILE *)NULL) {
- 		char	buf[BUFSIZ];
- 
  		sprintf(buf, E_fopen, file, mode, errmsg(errno));
  		log(L_WARNING, buf);
--- 340,346 ----
  	char	*mode = "r";
  #endif	FTRUNCATE
+ 	char buf[BUFSIZ];
  
  	if ((Qfp = fopen(file, mode)) == (FILE *)NULL) {
  		sprintf(buf, E_fopen, file, mode, errmsg(errno));
  		log(L_WARNING, buf);
***************
*** 375,380 ****
--- 377,397 ----
  		**	iterate to end of queue file
  		*/
+ 		if(getwd(oldpath) == NULL) {
+ 			sprintf(buf, E_getwd, oldpath);
+ 			log(L_WARNING, buf);
+ 			FCLOSE(Qfp);
+ 			return(FALSE);
+ 		}
+ 			
  		catchsig(interrupted);
  
+ 		/* cd to SPOOLDIR so new C News batch files can be handled */
+ 		if(chdir(SPOOLDIR) != 0){
+ 			sprintf(buf, E_chdir, SPOOLDIR, errmsg(errno));
+ 			log(L_WARNING, buf);
+ 			FCLOSE(Qfp);
+ 			return(FALSE);
+ 		}
+ 
  		while((fp = getfp(Qfp, Article, sizeof(Article))) != (FILE *)NULL) {
  			if (!sendarticle(host, fp)) {
***************
*** 826,829 ****
--- 843,853 ----
  	if (Qfp == (FILE *)NULL || Qfile == (char *)NULL)
  		return;
+ 
+ 	if(chdir(oldpath) != 0) {
+ 		char buf[BUFSIZ];
+ 
+ 		sprintf(buf, E_chdir, oldpath, errmsg(errno));
+ 		log(L_WARNING, buf);
+ 	}
  
  	if ((ReQueue_Fails && Stats.failed > 0) || !feof(Qfp)) {
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads