[patch] use mkstemp instead of mktemp.
Muthukumar Ratty
muthu@iqmail.net
Wed Jul 2 02:24:00 GMT 2003
> <URL:http://sources.redhat.com/ml/binutils/2003-03/msg00219.html>.
>
> This is turning into a FAQ, though infrequent enough that I
> believe people may forget why. Perhaps adding an obvious
> comment at the mktemp call site would help.
>
that sure would keep off some newbie trying it (like me:)
how about the following ...
--- binutils-cvs/bucomm.c Tue Jul 1 18:53:53 2003
+++ binutils/bucomm.c Tue Jul 1 19:13:49 2003
@@ -438,6 +438,7 @@ make_tempname (filename)
#endif
strcat (tmpname, "/");
strcat (tmpname, template);
+ /* mkstemp won't work with directories. so use mktemp */
mktemp (tmpname);
*slash = c;
}
@@ -445,6 +446,7 @@ make_tempname (filename)
{
tmpname = xmalloc (sizeof (template));
strcpy (tmpname, template);
+ /* mkstemp won't work with directories. so use mktemp */
mktemp (tmpname);
}
return tmpname;
> brgds, H-P
>
More information about the Binutils
mailing list