This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mkstemp in bucomm.c breaks mingw32 build


Hi Danny,

> > libiberty provides mkstemps().  Perhaps that should be used instead?
> 
> Yes, that was my workaround.

Fair enough.  I will check in the patch below.

Cheers
        Nick


2001-11-14  Nick Clifton  <nickc@cambridge.redhat.com>

	* bucomm.c (make_tempname): Use mkstemps instead of mkstemp, since
	not all systems provide mkstemp.

Index: binutils/bucomm.c
===================================================================
RCS file: /cvs/src/src/binutils/bucomm.c,v
retrieving revision 1.11
diff -p -c -r1.11 bucomm.c
*** bucomm.c	2001/11/12 16:17:39	1.11
--- bucomm.c	2001/11/14 11:54:01
***************
*** 35,40 ****
--- 35,43 ----
  typedef long time_t;
  #endif
  #endif
+ 
+ /* Ought to be defined in libiberty.h...  */
+ extern int mkstemps PARAMS ((char *, int));
  
  /* Error reporting */
  
*************** make_tempname (filename)
*** 233,246 ****
  #endif
        strcat (tmpname, "/");
        strcat (tmpname, template);
!       close (mkstemp (tmpname));
        *slash = c;
      }
    else
      {
        tmpname = xmalloc (sizeof (template));
        strcpy (tmpname, template);
!       close (mkstemp (tmpname));
      }
    return tmpname;
  }
--- 236,249 ----
  #endif
        strcat (tmpname, "/");
        strcat (tmpname, template);
!       close (mkstemps (tmpname, 0));
        *slash = c;
      }
    else
      {
        tmpname = xmalloc (sizeof (template));
        strcpy (tmpname, template);
!       close (mkstemps (tmpname, 0));
      }
    return tmpname;
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]