diff options
Diffstat (limited to 'indra/llvfs')
| -rw-r--r-- | indra/llvfs/lldir.cpp | 9 | ||||
| -rw-r--r-- | indra/llvfs/lllfsthread.cpp | 6 | 
2 files changed, 7 insertions, 8 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index da4abde451..29b6f490c8 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -91,15 +91,16 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)  	S32 result;  	while (getNextFileInDir(dirname, mask, filename, FALSE))  	{ -		if ((filename == ".") || (filename == "..")) +		fullpath = dirname; +		fullpath += getDirDelimiter(); +		fullpath += filename; + +		if(LLFile::isdir(fullpath))  		{  			// skipping directory traversal filenames  			count++;  			continue;  		} -		fullpath = dirname; -		fullpath += getDirDelimiter(); -		fullpath += filename;  		S32 retry_count = 0;  		while (retry_count < 5) diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp index e85cc437f4..49c198a82d 100644 --- a/indra/llvfs/lllfsthread.cpp +++ b/indra/llvfs/lllfsthread.cpp @@ -188,7 +188,7 @@ bool LLLFSThread::Request::processRequest()  	if (mOperation ==  FILE_READ)  	{  		llassert(mOffset >= 0); -		LLAPRFile infile ; +		LLAPRFile infile ; // auto-closes  		infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool());  		if (!infile.getFileHandle())  		{ @@ -204,7 +204,6 @@ bool LLLFSThread::Request::processRequest()  		llassert_always(off >= 0);  		mBytesRead = infile.read(mBuffer, mBytes );  		complete = true; -		infile.close() ;  // 		llinfos << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << llendl;  	}  	else if (mOperation ==  FILE_WRITE) @@ -212,7 +211,7 @@ bool LLLFSThread::Request::processRequest()  		apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY;  		if (mOffset < 0)  			flags |= APR_APPEND; -		LLAPRFile outfile ; +		LLAPRFile outfile ; // auto-closes  		outfile.open(mFileName, flags, mThread->getLocalAPRFilePool());  		if (!outfile.getFileHandle())  		{ @@ -232,7 +231,6 @@ bool LLLFSThread::Request::processRequest()  		}  		mBytesRead = outfile.write(mBuffer, mBytes );  		complete = true; -  // 		llinfos << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << llendl;  	}  	else  | 
