This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mkstemp in bucomm.c breaks mingw32 build
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: binutils at sources dot redhat dot com
- Date: 14 Nov 2001 11:55:53 +0000
- Subject: Re: mkstemp in bucomm.c breaks mingw32 build
- References: <20011113213022.27179.qmail@web14508.mail.yahoo.com>
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;
}