Message-Id: <199804271144.NAA33208@ieva06.lanet.lv> From: "Andris Pavenis" To: Eli Zaretskii Date: Mon, 27 Apr 1998 13:42:58 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Patch to add target specific cleanup for gcc.c CC: djgpp-workers AT delorie DOT com References: <199804270915 DOT LAA57422 AT ieva06 DOT lanet DOT lv> In-reply-to: Precedence: bulk Date sent: Mon, 27 Apr 1998 13:05:01 +0300 (IDT) From: Eli Zaretskii Subject: Re: Patch to add target specific cleanup for gcc.c > > On Mon, 27 Apr 1998, Andris Pavenis wrote: > > > mktemp() only generates the name but file is not > > actually created. The name after that is given to some other program for > > example cc1.exe as name of object file to be generated. Unfortunatelly > > under Windows it is still possible for gcc from other DOS session to generate > > the same name of temporary file. > > I sent patches to this list a few weeks ago that fix that bug. If you > don't have them, I can resend them (or you can search the mail archives at > http://www.delorie.com/djgpp/mail-archives/). > > I think that with the fixed library functions MKTEM__EACH_FILE should > solve the problems. > As I understood You thought Your patches to int mkstemp (char *template) mkstemp() not only returns name but also creates the file. The only information I need is name of the file, so I then have to close it immediatelly not to waste file descriptors. After that another program (cpp.exe, cc1.exe, cc1plus.exe, or as.exe) opens it once more for output. I think that creating one extra file can still be in average faster than opening EVERY temporary files once more. Of course this is safer than approach I used, but is it worth the overhead we'll have Andris