Return-Path: <@roma.atc.olivetti.com:jerry@olivetti.com>
Received: from roma.atc.olivetti.com (roma.atc.olivetti.com [129.189.134.10]) by leibniz.math.psu.edu (8.6.12/8.6.9) with SMTP id OAA03449 for <barr@math.psu.edu>; Thu, 21 Mar 1996 14:03:29 -0500
Received: from strobe.ATC.Olivetti.Com ([129.189.134.6]) by roma.atc.olivetti.com with SMTP id <80301>; Thu, 21 Mar 1996 11:02:25 -0800
Received: by strobe.ATC.Olivetti.Com (4.1/SMI-4.1)
	id AA01824; Thu, 21 Mar 96 11:02:22 PST
Date: 	Thu, 21 Mar 1996 11:02:22 -0800
From: jerry@olivetti.com (Jerry Aguirre)
Message-Id: <9603211902.AA01824@strobe.ATC.Olivetti.Com>
To: barr@math.psu.edu, chen@cc.nctu.edu.tw
Subject: Re:  (fwd) Re: Unoff4 -- Now this is strange.

The code in crosspost was largly lifted from overchan and innd.  When
the first attempt to create a link fails it calls MakeSpoolDir().
Unfortunately the two pieces of code didn't mesh well.

This patch should correct the problem:

*** backends/crosspost.c.bak	Tue Feb  6 11:18:28 1996
--- backends/crosspost.c	Thu Mar 21 10:57:58 1996
***************
*** 51,58 ****
  
  
  /*
! **  Make spool directory.  Return 0 if ok,
! **  else -1.
  */
  STATIC BOOL
  MakeSpoolDir(Name)
--- 51,57 ----
  
  
  /*
! **  Make spool directory.  Return FALSE on error.
  */
  STATIC BOOL
  MakeSpoolDir(Name)
***************
*** 61,69 ****
      register char	*p;
      BOOL		made;
  
-     if (InSpoolDir)
- 	return FALSE;
- 
      /* Optimize common case -- parent almost always exists. */
      if (MakeDir(Name))
  	return TRUE;
--- 60,65 ----
***************
*** 140,151 ****
  		for (j--; (j > 0) && (path[j] != '/'); j--) ;
  		if (path[j] == '/') {
  		    path[j] = '\0';
! 		    if (MakeSpoolDir(path)) { /* try making parent dir */
  			(void)fprintf(stderr, "crosspost cant mkdir %s\n",
  				path);
  		    }
  		    else {
! 			if (link(names[0], names[i]) < 0) { /* 2nd try to link */
  #if	defined(DONT_HAVE_SYMLINK)
  			    (void)fprintf(stderr, "crosspost cant link %s %s",
  				names[0], names[i]);
--- 136,149 ----
  		for (j--; (j > 0) && (path[j] != '/'); j--) ;
  		if (path[j] == '/') {
  		    path[j] = '\0';
! 		    /* try making parent dir */
! 		    if (MakeSpoolDir(path) == FALSE) {
  			(void)fprintf(stderr, "crosspost cant mkdir %s\n",
  				path);
  		    }
  		    else {
! 			/* 2nd try to link */
! 			if (link(names[0], names[i]) < 0) {
  #if	defined(DONT_HAVE_SYMLINK)
  			    (void)fprintf(stderr, "crosspost cant link %s %s",
  				names[0], names[i]);
