apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@xbc.nu>
Subject Re: apr_file_mktemp broken on windows
Date Thu, 13 May 2004 02:13:29 GMT
Greg Hudson wrote:

>In case rbb's forward was too cryptic, I think the chief problem is
>that file_io/unix/mktemp.c:gettemp() (which is not generally used on
>Unix since APR uses mkstemp() there) does a direct comparison with
>APR_EEXIST instead of using APR_STATUS_IS_EEXIST.  So on Windows, APR
>winds up returning a "file already exists" error instead of catching
Also randseed initialization is not thread-safe, and the typecast from 
apr_time_now() is wrong.

>It is also perhaps impolite to reseed the libc random number
Yes. We should use something from apr_random, using a private 
random-number pool.

>  And using GetTempFileName() might be more efficient in
I don't think so; I can't believe the Windows implementation is 
significantly smarter, and you'd have to convert the file name template 

-- Brane

View raw message