*** fileio.c.orig	Mon Apr 15 17:28:31 1996
--- fileio.c	Tue Nov 25 17:18:22 1997
***************
*** 596,606 ****
  }
  
  
! char *tempname(zip)
  char *zip;              /* path name of zip file to generate temp name for */
  
  /* Return a temporary file name in its own malloc'ed space, using tempath. */
  {
  #ifdef CMS_MVS
     return tmpnam(NULL);
  #else /* !CMS_MVS */
--- 596,609 ----
  }
  
  
! char *tempname(zip, fpfp)
  char *zip;              /* path name of zip file to generate temp name for */
+ FILE **fpfp;
  
  /* Return a temporary file name in its own malloc'ed space, using tempath. */
  {
+    int fdfd;
+ 
  #ifdef CMS_MVS
     return tmpnam(NULL);
  #else /* !CMS_MVS */
***************
*** 634,640 ****
    }
    else
    {
!     if ((t = malloc(12)) == NULL)
        return NULL;
      *t = 0;
    }
--- 637,643 ----
    }
    else
    {
!     if ((t = malloc(17)) == NULL)
        return NULL;
      *t = 0;
    }
***************
*** 645,652 ****
      return t;
    }
  #else
!   strcat(t, "ziXXXXXX"); /* must use lowercase for Linux dos file system */
!   return mktemp(t);
  #endif
  #endif /* ?CMS_MVS */
  }
--- 648,670 ----
      return t;
    }
  #else
!   strcat(t, "/tmp/ziXXXXXX"); /* must use lowercase for Linux dos file system */
!   fdfd = mkstemp(t);
!   if (fdfd == -1)
!   {
! 	free(t);
! 	return NULL;
!   }
! 
!   *fpfp = fdopen(fdfd, "w+");
!   if (*fpfp == NULL)
!   {
! 	free(t);
! 	close(fdfd);
! 	return NULL;
!   }
! 
!   return t;
  #endif
  #endif /* ?CMS_MVS */
  }
