Work around multithreading issue in ndFile::isExist.

Nicky 2013-04-02 01:55:26 +02:00
parent adc75490ce
commit a52bd26520
1 changed files with 6 additions and 5 deletions

View File

@ -220,11 +220,12 @@ namespace nd
bool ndFile::isExist(const std::string& filename, ndVolatileAPRPool* pool, apr_int32_t flags)
{
FILE *pFile = LLFile::fopen( filename, nd::aprhelper::ndConvertOpenFlags( flags, filename ) );
if( pFile )
LLFile::close( pFile );
return 0 != pFile;
llstat oStat;
int nRes = LLFile::stat( filename, &oStat );
if( 0 == nRes )
return S_ISREG( oStat.st_mode );
return false;
}
S32 ndFile::size(const std::string& aFilename, ndVolatileAPRPool* pool)