Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-19 Thread FX
> The new test failed on Linux/x86. Yes, it might if you have a low limit on the number of concurrently open files. I've lowered the number to 30 (revision 171180). FX

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-19 Thread H.J. Lu
On Thu, Mar 17, 2011 at 5:21 AM, FX wrote: > Thanks for the review! > >> - Use the type size_t for tempdirlen as that is the return type of >> strlen() and argument type for get_mem(). >> >> - You can use a const size_t variable for the length of the string >> "slash" rather than calling strlen()

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-18 Thread Janne Blomqvist
On Thu, Mar 17, 2011 at 14:21, FX wrote: > Thanks for the review! > >> - Use the type size_t for tempdirlen as that is the return type of >> strlen() and argument type for get_mem(). >> >> - You can use a const size_t variable for the length of the string >> "slash" rather than calling strlen() in

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-17 Thread FX
Thanks for the review! > - Use the type size_t for tempdirlen as that is the return type of > strlen() and argument type for get_mem(). > > - You can use a const size_t variable for the length of the string > "slash" rather than calling strlen() in the do-while loop. Both OK. > - Don't set errn

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-17 Thread Janne Blomqvist
On Wed, Mar 16, 2011 at 23:50, FX wrote: >> If M$ mktemp when already 26 files exist with the same prefix at least >> properly fails, then it would be better to just retry with a changed prefix >> if it fails. > > > Done exactly that. Manually tested on i586-pc-mingw32, regtested on > x86_64-linu

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-16 Thread FX
> If M$ mktemp when already 26 files exist with the same prefix at least > properly fails, then it would be better to just retry with a changed prefix > if it fails. Done exactly that. Manually tested on i586-pc-mingw32, regtested on x86_64-linux by editing config.h to fake the absence of mkstem

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-14 Thread Janne Blomqvist
On Mon, Mar 14, 2011 at 12:31, Jakub Jelinek wrote: > On Mon, Mar 14, 2011 at 12:18:16PM +0200, Janne Blomqvist wrote: >> On Sat, Mar 12, 2011 at 17:21, FX wrote: >> A static variable which is modified introduces a race condition. > > That is true. > >> Secondly, you reset the count to 0 at the s

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-14 Thread Kai Tietz
2011/3/14 Jakub Jelinek : > On Mon, Mar 14, 2011 at 12:18:16PM +0200, Janne Blomqvist wrote: >> On Sat, Mar 12, 2011 at 17:21, FX wrote: >> A static variable which is modified introduces a race condition. > > That is true. > >> Secondly, you reset the count to 0 at the start of every loop which >>

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-14 Thread Jakub Jelinek
On Mon, Mar 14, 2011 at 12:18:16PM +0200, Janne Blomqvist wrote: > On Sat, Mar 12, 2011 at 17:21, FX wrote: > A static variable which is modified introduces a race condition. That is true. > Secondly, you reset the count to 0 at the start of every loop which > makes the static thing superfluous?

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-14 Thread Janne Blomqvist
On Sat, Mar 12, 2011 at 17:21, FX wrote: > The attached patch fixes half of PR 47439. On platform with weak or > historical implementations of mktemp(), this function cannot generate more > than 26 unique filenames for a given base. This happens in particular on > Windows, and limits us to 26 s

Re: [libgfortran, patch] More than 26 temporary files with weak mktemp()

2011-03-12 Thread Jerry DeLisle
On 03/12/2011 07:21 AM, FX wrote: The attached patch fixes half of PR 47439. On platform with weak or historical implementations of mktemp(), this function cannot generate more than 26 unique filenames for a given base. This happens in particular on Windows, and limits us to 26 scratch files o