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: [patch] use mkstemp instead of mktemp.


> <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
>


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