cvs commit: patches/ed ed-0.2-mkstemp-1.patch ed-0.2-mkstemp.patch

jim at linuxfromscratch.org jim at linuxfromscratch.org
Fri Jun 4 08:43:12 PDT 2004


jim         04/06/04 09:43:12

  Added:       ed       ed-0.2-mkstemp-1.patch
  Removed:     ed       ed-0.2-mkstemp.patch
  Log:
  Naming Scheme Update
  
  Revision  Changes    Path
  1.1                  patches/ed/ed-0.2-mkstemp-1.patch
  
  Index: ed-0.2-mkstemp-1.patch
  ===================================================================
  Submitted By: LFS Book <lfs-book at linuxfromscratch.org>
  Date: 2003-10-05
  Initial Package Version: 0.2
  Origin: Slackware Source
  Description: Use mkstemp instead of mktemp.
  diff -Naur ed-0.2/buf.c ed-0.2-2/buf.c
  --- ed-0.2/buf.c	Sat Nov 19 04:37:59 1994
  +++ ed-0.2-2/buf.c	Tue May 28 18:38:23 2002
  @@ -200,13 +200,13 @@
   int
   open_sbuf ()
   {
  -  char *mktemp ();
  -  int u;
  +  int u, sfd;
   
     isbinary = newline_added = 0;
     u = umask(077);
     strcpy (sfn, "/tmp/ed.XXXXXX");
  -  if (mktemp (sfn) == NULL || (sfp = fopen (sfn, "w+")) == NULL)
  +  sfd = mkstemp(sfn);
  +    if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)
       {
         fprintf (stderr, "%s: %s\n", sfn, strerror (errno));
         sprintf (errmsg, "Cannot open temp file");
  
  
  



More information about the patches mailing list