aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorJacek Antonelli2010-02-08 17:01:00 -0600
committerJacek Antonelli2010-02-08 17:01:00 -0600
commitd96e672c7fa0cb59ef0c30163326bb40220e745a (patch)
tree0578f6258788f44f91dbf84eebdb09d994e2a0e5 /linden/indra/newview
parentFixed login screen only allowing 16 chars per name. (diff)
downloadmeta-impy-d96e672c7fa0cb59ef0c30163326bb40220e745a.zip
meta-impy-d96e672c7fa0cb59ef0c30163326bb40220e745a.tar.gz
meta-impy-d96e672c7fa0cb59ef0c30163326bb40220e745a.tar.bz2
meta-impy-d96e672c7fa0cb59ef0c30163326bb40220e745a.tar.xz
Ported many APR changes from Snowglobe.
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/llappviewer.cpp18
-rw-r--r--linden/indra/newview/llfloateranimpreview.cpp2
-rw-r--r--linden/indra/newview/lltexturecache.cpp73
-rw-r--r--linden/indra/newview/llviewermenufile.cpp2
-rw-r--r--linden/indra/newview/llvoavatar.cpp2
-rw-r--r--linden/indra/newview/primbackup.cpp2
6 files changed, 43 insertions, 56 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index a57050d..cdecaf4 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -2487,7 +2487,7 @@ void LLAppViewer::handleViewerCrash()
2487 llinfos << "Creating crash marker file " << crash_file_name << llendl; 2487 llinfos << "Creating crash marker file " << crash_file_name << llendl;
2488 2488
2489 LLAPRFile crash_file ; 2489 LLAPRFile crash_file ;
2490 crash_file.open(crash_file_name, LL_APR_W); 2490 crash_file.open(crash_file_name, LL_APR_W, LLAPRFile::local);
2491 if (crash_file.getFileHandle()) 2491 if (crash_file.getFileHandle())
2492 { 2492 {
2493 LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; 2493 LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL;
@@ -2555,11 +2555,11 @@ bool LLAppViewer::anotherInstanceRunning()
2555 LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; 2555 LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL;
2556 2556
2557 //Freeze case checks 2557 //Freeze case checks
2558 if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB)) 2558 if (LLAPRFile::isExist(marker_file, LL_APR_RB))
2559 { 2559 {
2560 // File exists, try opening with write permissions 2560 // File exists, try opening with write permissions
2561 LLAPRFile outfile ; 2561 LLAPRFile outfile ;
2562 outfile.open(marker_file, LL_APR_WB); 2562 outfile.open(marker_file, LL_APR_WB, LLAPRFile::global);
2563 apr_file_t* fMarker = outfile.getFileHandle() ; 2563 apr_file_t* fMarker = outfile.getFileHandle() ;
2564 if (!fMarker) 2564 if (!fMarker)
2565 { 2565 {
@@ -2599,24 +2599,24 @@ void LLAppViewer::initMarkerFile()
2599 std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); 2599 std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
2600 2600
2601 2601
2602 if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning()) 2602 if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning())
2603 { 2603 {
2604 gLastExecEvent = LAST_EXEC_FROZE; 2604 gLastExecEvent = LAST_EXEC_FROZE;
2605 LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; 2605 LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
2606 } 2606 }
2607 2607
2608 if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) 2608 if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB))
2609 { 2609 {
2610 LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL; 2610 LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL;
2611 gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; 2611 gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
2612 } 2612 }
2613 if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB)) 2613 if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB))
2614 { 2614 {
2615 llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl; 2615 llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl;
2616 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; 2616 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
2617 else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; 2617 else gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
2618 } 2618 }
2619 if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) 2619 if(LLAPRFile::isExist(error_marker_file, LL_APR_RB))
2620 { 2620 {
2621 LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL; 2621 LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL;
2622 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; 2622 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
@@ -2635,7 +2635,7 @@ void LLAppViewer::initMarkerFile()
2635 2635
2636 // Create the marker file for this execution & lock it 2636 // Create the marker file for this execution & lock it
2637 apr_status_t s; 2637 apr_status_t s;
2638 s = mMarkerFile.open(mMarkerFileName, LL_APR_W, gAPRPoolp); 2638 s = mMarkerFile.open(mMarkerFileName, LL_APR_W, LLAPRFile::global);
2639 2639
2640 if (s == APR_SUCCESS && mMarkerFile.getFileHandle()) 2640 if (s == APR_SUCCESS && mMarkerFile.getFileHandle())
2641 { 2641 {
@@ -3716,7 +3716,7 @@ void LLAppViewer::sendLogoutRequest()
3716 mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME); 3716 mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME);
3717 3717
3718 LLAPRFile outfile ; 3718 LLAPRFile outfile ;
3719 outfile.open(mLogoutMarkerFileName, LL_APR_W); 3719 outfile.open(mLogoutMarkerFileName, LL_APR_W, LLAPRFile::global);
3720 mLogoutMarkerFile = outfile.getFileHandle() ; 3720 mLogoutMarkerFile = outfile.getFileHandle() ;
3721 if (mLogoutMarkerFile) 3721 if (mLogoutMarkerFile)
3722 { 3722 {
diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp
index 162456b..57ee161 100644
--- a/linden/indra/newview/llfloateranimpreview.cpp
+++ b/linden/indra/newview/llfloateranimpreview.cpp
@@ -238,7 +238,7 @@ BOOL LLFloaterAnimPreview::postBuild()
238 S32 file_size; 238 S32 file_size;
239 239
240 LLAPRFile infile ; 240 LLAPRFile infile ;
241 infile.open(mFilenameAndPath, LL_APR_RB, NULL, &file_size); 241 infile.open(mFilenameAndPath, LL_APR_RB, LLAPRFile::global, &file_size);
242 242
243 if (!infile.getFileHandle()) 243 if (!infile.getFileHandle())
244 { 244 {
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp
index 3b724e2..9c3bed2 100644
--- a/linden/indra/newview/lltexturecache.cpp
+++ b/linden/indra/newview/lltexturecache.cpp
@@ -175,7 +175,7 @@ private:
175 175
176bool LLTextureCacheLocalFileWorker::doRead() 176bool LLTextureCacheLocalFileWorker::doRead()
177{ 177{
178 S32 local_size = LLAPRFile::size(mFileName, mCache->getLocalAPRFilePool()); 178 S32 local_size = LLAPRFile::size(mFileName);
179 179
180 if (local_size > 0 && mFileName.size() > 4) 180 if (local_size > 0 && mFileName.size() > 4)
181 { 181 {
@@ -249,7 +249,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
249 } 249 }
250 mReadData = new U8[mDataSize]; 250 mReadData = new U8[mDataSize];
251 251
252 S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); 252 S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize);
253 253
254 if (bytes_read != mDataSize) 254 if (bytes_read != mDataSize)
255 { 255 {
@@ -318,11 +318,11 @@ bool LLTextureCacheRemoteWorker::doRead()
318 { 318 {
319 std::string filename = mCache->getLocalFileName(mID); 319 std::string filename = mCache->getLocalFileName(mID);
320 local_filename = filename + ".j2c"; 320 local_filename = filename + ".j2c";
321 local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); 321 local_size = LLAPRFile::size(local_filename);
322 if (local_size == 0) 322 if (local_size == 0)
323 { 323 {
324 local_filename = filename + ".tga"; 324 local_filename = filename + ".tga";
325 local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); 325 local_size = LLAPRFile::size(local_filename);
326 if (local_size > 0) 326 if (local_size > 0)
327 { 327 {
328 mImageFormat = IMG_CODEC_TGA; 328 mImageFormat = IMG_CODEC_TGA;
@@ -390,8 +390,7 @@ bool LLTextureCacheRemoteWorker::doRead()
390 mDataSize = local_size; 390 mDataSize = local_size;
391 } 391 }
392 mReadData = new U8[mDataSize]; 392 mReadData = new U8[mDataSize];
393 S32 bytes_read = LLAPRFile::readEx(local_filename, 393 S32 bytes_read = LLAPRFile::readEx(local_filename, mReadData, mOffset, mDataSize);
394 mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool());
395 if (bytes_read != mDataSize) 394 if (bytes_read != mDataSize)
396 { 395 {
397// llwarns << "Error reading file from local cache: " << local_filename 396// llwarns << "Error reading file from local cache: " << local_filename
@@ -485,7 +484,7 @@ bool LLTextureCacheRemoteWorker::doRead()
485 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset; 484 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
486 mReadData = new U8[size]; 485 mReadData = new U8[size];
487 S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, 486 S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName,
488 mReadData, offset, size, mCache->getLocalAPRFilePool()); 487 mReadData, offset, size);
489 if (bytes_read != size) 488 if (bytes_read != size)
490 { 489 {
491// llwarns << "LLTextureCacheWorker: " << mID 490// llwarns << "LLTextureCacheWorker: " << mID
@@ -511,7 +510,7 @@ bool LLTextureCacheRemoteWorker::doRead()
511 if (mFileHandle == LLLFSThread::nullHandle()) 510 if (mFileHandle == LLLFSThread::nullHandle())
512 { 511 {
513 std::string filename = mCache->getTextureFileName(mID); 512 std::string filename = mCache->getTextureFileName(mID);
514 S32 filesize = LLAPRFile::size(filename, mCache->getLocalAPRFilePool()); 513 S32 filesize = LLAPRFile::size(filename);
515 if (filesize > mOffset) 514 if (filesize > mOffset)
516 { 515 {
517 S32 datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize; 516 S32 datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize;
@@ -570,7 +569,7 @@ bool LLTextureCacheRemoteWorker::doRead()
570 } 569 }
571#else 570#else
572 std::string filename = mCache->getTextureFileName(mID); 571 std::string filename = mCache->getTextureFileName(mID);
573 S32 filesize = LLAPRFile::size(filename, mCache->getLocalAPRFilePool()); 572 S32 filesize = LLAPRFile::size(filename);
574 S32 bytes_read = 0; 573 S32 bytes_read = 0;
575 if (filesize > mOffset) 574 if (filesize > mOffset)
576 { 575 {
@@ -592,8 +591,7 @@ bool LLTextureCacheRemoteWorker::doRead()
592 mReadData = data; 591 mReadData = data;
593 bytes_read = LLAPRFile::readEx(filename, 592 bytes_read = LLAPRFile::readEx(filename,
594 mReadData + data_offset, 593 mReadData + data_offset,
595 file_offset, file_size, 594 file_offset, file_size);
596 mCache->getLocalAPRFilePool());
597 if (bytes_read != file_size) 595 if (bytes_read != file_size)
598 { 596 {
599// llwarns << "LLTextureCacheWorker: " << mID 597// llwarns << "LLTextureCacheWorker: " << mID
@@ -696,7 +694,7 @@ bool LLTextureCacheRemoteWorker::doWrite()
696 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE); 694 llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
697 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset; 695 S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
698 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset; 696 S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
699 S32 bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size, mCache->getLocalAPRFilePool()); 697 S32 bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size);
700 698
701 if (bytes_written <= 0) 699 if (bytes_written <= 0)
702 { 700 {
@@ -774,8 +772,7 @@ bool LLTextureCacheRemoteWorker::doWrite()
774 772
775 bytes_written = LLAPRFile::writeEx(filename, 773 bytes_written = LLAPRFile::writeEx(filename,
776 mWriteData + data_offset, 774 mWriteData + data_offset,
777 file_offset, file_size, 775 file_offset, file_size);
778 mCache->getLocalAPRFilePool());
779 if (bytes_written <= 0) 776 if (bytes_written <= 0)
780 { 777 {
781 mDataSize = -1; // failed 778 mDataSize = -1; // failed
@@ -975,8 +972,7 @@ bool LLTextureCache::appendToTextureEntryList(const LLUUID& id, S32 bodysize)
975 Entry* entry = new Entry(id, bodysize, time(NULL)); 972 Entry* entry = new Entry(id, bodysize, time(NULL));
976 973
977 LLAPRFile::writeEx(mTexturesDirEntriesFileName, 974 LLAPRFile::writeEx(mTexturesDirEntriesFileName,
978 (U8*)entry, -1, 1*sizeof(Entry), 975 (U8*)entry, -1, 1*sizeof(Entry));
979 getLocalAPRFilePool());
980 delete entry; 976 delete entry;
981 if (iter != mTexturesSizeMap.end()) 977 if (iter != mTexturesSizeMap.end())
982 { 978 {
@@ -1024,8 +1020,8 @@ void LLTextureCache::purgeCache(ELLPath location)
1024 { 1020 {
1025 setDirNames(location); 1021 setDirNames(location);
1026 1022
1027 LLAPRFile::remove(mHeaderEntriesFileName, getLocalAPRFilePool()); 1023 LLAPRFile::remove(mHeaderEntriesFileName);
1028 LLAPRFile::remove(mHeaderDataFileName, getLocalAPRFilePool()); 1024 LLAPRFile::remove(mHeaderDataFileName);
1029 } 1025 }
1030 purgeAllTextures(true); 1026 purgeAllTextures(true);
1031} 1027}
@@ -1092,11 +1088,10 @@ void LLTextureCache::readHeaderCache()
1092 LLMutexLock lock(&mHeaderMutex); 1088 LLMutexLock lock(&mHeaderMutex);
1093 mHeaderEntriesInfo.mVersion = 0.f; 1089 mHeaderEntriesInfo.mVersion = 0.f;
1094 mHeaderEntriesInfo.mEntries = 0; 1090 mHeaderEntriesInfo.mEntries = 0;
1095 if (LLAPRFile::isExist(mHeaderEntriesFileName, getLocalAPRFilePool())) 1091 if (LLAPRFile::isExist(mHeaderEntriesFileName))
1096 { 1092 {
1097 LLAPRFile::readEx(mHeaderEntriesFileName, 1093 LLAPRFile::readEx(mHeaderEntriesFileName,
1098 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), 1094 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
1099 getLocalAPRFilePool());
1100 } 1095 }
1101 if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion) 1096 if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion)
1102 { 1097 {
@@ -1106,8 +1101,7 @@ void LLTextureCache::readHeaderCache()
1106 mHeaderEntriesInfo.mVersion = sHeaderCacheVersion; 1101 mHeaderEntriesInfo.mVersion = sHeaderCacheVersion;
1107 1102
1108 LLAPRFile::writeEx(mHeaderEntriesFileName, 1103 LLAPRFile::writeEx(mHeaderEntriesFileName,
1109 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), 1104 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
1110 getLocalAPRFilePool());
1111 } 1105 }
1112 } 1106 }
1113 else 1107 else
@@ -1118,8 +1112,7 @@ void LLTextureCache::readHeaderCache()
1118 Entry* entries = new Entry[num_entries]; 1112 Entry* entries = new Entry[num_entries];
1119 { 1113 {
1120 LLAPRFile::readEx(mHeaderEntriesFileName, 1114 LLAPRFile::readEx(mHeaderEntriesFileName,
1121 (U8*)entries, sizeof(EntriesInfo), num_entries*sizeof(Entry), 1115 (U8*)entries, sizeof(EntriesInfo), num_entries*sizeof(Entry));
1122 getLocalAPRFilePool());
1123 } 1116 }
1124 typedef std::set<lru_data*, lru_data::Compare> lru_set_t; 1117 typedef std::set<lru_data*, lru_data::Compare> lru_set_t;
1125 lru_set_t lru; 1118 lru_set_t lru;
@@ -1165,7 +1158,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories)
1165 LLFile::rmdir(dirname); 1158 LLFile::rmdir(dirname);
1166 } 1159 }
1167 } 1160 }
1168 LLAPRFile::remove(mTexturesDirEntriesFileName, getLocalAPRFilePool()); 1161 LLAPRFile::remove(mTexturesDirEntriesFileName);
1169 if (purge_directories) 1162 if (purge_directories)
1170 { 1163 {
1171 LLFile::rmdir(mTexturesDirName); 1164 LLFile::rmdir(mTexturesDirName);
@@ -1186,7 +1179,7 @@ void LLTextureCache::purgeTextures(bool validate)
1186 1179
1187 LLMutexLock lock(&mHeaderMutex); 1180 LLMutexLock lock(&mHeaderMutex);
1188 1181
1189 S32 filesize = LLAPRFile::size(mTexturesDirEntriesFileName, getLocalAPRFilePool()); 1182 S32 filesize = LLAPRFile::size(mTexturesDirEntriesFileName);
1190 S32 num_entries = filesize / sizeof(Entry); 1183 S32 num_entries = filesize / sizeof(Entry);
1191 if (num_entries * (S32)sizeof(Entry) != filesize) 1184 if (num_entries * (S32)sizeof(Entry) != filesize)
1192 { 1185 {
@@ -1201,8 +1194,7 @@ void LLTextureCache::purgeTextures(bool validate)
1201 1194
1202 Entry* entries = new Entry[num_entries]; 1195 Entry* entries = new Entry[num_entries];
1203 S32 bytes_read = LLAPRFile::readEx(mTexturesDirEntriesFileName, 1196 S32 bytes_read = LLAPRFile::readEx(mTexturesDirEntriesFileName,
1204 (U8*)entries, 0, num_entries*sizeof(Entry), 1197 (U8*)entries, 0, num_entries*sizeof(Entry));
1205 getLocalAPRFilePool());
1206 if (bytes_read != filesize) 1198 if (bytes_read != filesize)
1207 { 1199 {
1208 LL_WARNS("TextureCache") << "Bad cache file (2): " << mTexturesDirEntriesFileName << " Purging." << LL_ENDL; 1200 LL_WARNS("TextureCache") << "Bad cache file (2): " << mTexturesDirEntriesFileName << " Purging." << LL_ENDL;
@@ -1261,7 +1253,7 @@ void LLTextureCache::purgeTextures(bool validate)
1261 if (uuididx == validate_idx) 1253 if (uuididx == validate_idx)
1262 { 1254 {
1263 LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mSize << LL_ENDL; 1255 LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mSize << LL_ENDL;
1264 S32 bodysize = LLAPRFile::size(filename, getLocalAPRFilePool()); 1256 S32 bodysize = LLAPRFile::size(filename);
1265 if (bodysize != entries[idx].mSize) 1257 if (bodysize != entries[idx].mSize)
1266 { 1258 {
1267 LL_WARNS("TextureCache") << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mSize 1259 LL_WARNS("TextureCache") << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mSize
@@ -1295,10 +1287,9 @@ void LLTextureCache::purgeTextures(bool validate)
1295 << num_entries << " (" << num_entries*sizeof(Entry)/1024 << "KB)" 1287 << num_entries << " (" << num_entries*sizeof(Entry)/1024 << "KB)"
1296 << LL_ENDL; 1288 << LL_ENDL;
1297 1289
1298 LLAPRFile::remove(mTexturesDirEntriesFileName, getLocalAPRFilePool()); 1290 LLAPRFile::remove(mTexturesDirEntriesFileName);
1299 LLAPRFile::writeEx(mTexturesDirEntriesFileName, 1291 LLAPRFile::writeEx(mTexturesDirEntriesFileName,
1300 (U8*)&entries[0], 0, num_entries*sizeof(Entry), 1292 (U8*)&entries[0], 0, num_entries*sizeof(Entry));
1301 getLocalAPRFilePool());
1302 1293
1303 mTexturesSizeTotal = 0; 1294 mTexturesSizeTotal = 0;
1304 mTexturesSizeMap.clear(); 1295 mTexturesSizeMap.clear();
@@ -1345,7 +1336,7 @@ void LLTextureCache::purgeTextureFilesTimeSliced(BOOL force_all)
1345 for (LLTextureCache::filename_list_t::iterator iter = mFilesToDelete.begin(); iter!=mFilesToDelete.end(); ) 1336 for (LLTextureCache::filename_list_t::iterator iter = mFilesToDelete.begin(); iter!=mFilesToDelete.end(); )
1346 { 1337 {
1347 LLTextureCache::filename_list_t::iterator iter2 = iter++; 1338 LLTextureCache::filename_list_t::iterator iter2 = iter++;
1348 LLAPRFile::remove(*iter2, NULL); 1339 LLAPRFile::remove(*iter2);
1349 mFilesToDelete.erase(iter2); 1340 mFilesToDelete.erase(iter2);
1350 howmany++; 1341 howmany++;
1351 1342
@@ -1416,8 +1407,7 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, bool touch, S32* image
1416 mHeaderIDMap[id] = idx; 1407 mHeaderIDMap[id] = idx;
1417 // Update Info 1408 // Update Info
1418 LLAPRFile::writeEx(mHeaderEntriesFileName, 1409 LLAPRFile::writeEx(mHeaderEntriesFileName,
1419 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), 1410 (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo));
1420 getLocalAPRFilePool());
1421 } 1411 }
1422 else if (!mLRU.empty()) 1412 else if (!mLRU.empty())
1423 { 1413 {
@@ -1443,8 +1433,7 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, bool touch, S32* image
1443 Entry* entry = new Entry(id, *imagesize, time(NULL)); 1433 Entry* entry = new Entry(id, *imagesize, time(NULL));
1444 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); 1434 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1445 LLAPRFile::writeEx(mHeaderEntriesFileName, 1435 LLAPRFile::writeEx(mHeaderEntriesFileName,
1446 (U8*)entry, offset, sizeof(Entry), 1436 (U8*)entry, offset, sizeof(Entry));
1447 getLocalAPRFilePool());
1448 delete entry; 1437 delete entry;
1449 } 1438 }
1450 else if (imagesize) 1439 else if (imagesize)
@@ -1454,8 +1443,7 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, bool touch, S32* image
1454 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); 1443 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1455 1444
1456 LLAPRFile::readEx(mHeaderEntriesFileName, 1445 LLAPRFile::readEx(mHeaderEntriesFileName,
1457 (U8*)&entry, offset, sizeof(Entry), 1446 (U8*)&entry, offset, sizeof(Entry));
1458 getLocalAPRFilePool());
1459 *imagesize = entry.mSize; 1447 *imagesize = entry.mSize;
1460 } 1448 }
1461 } 1449 }
@@ -1608,8 +1596,7 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id)
1608 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); 1596 S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry);
1609 1597
1610 LLAPRFile::writeEx(mHeaderEntriesFileName, 1598 LLAPRFile::writeEx(mHeaderEntriesFileName,
1611 (U8*)entry, offset, sizeof(Entry), 1599 (U8*)entry, offset, sizeof(Entry));
1612 getLocalAPRFilePool());
1613 delete entry; 1600 delete entry;
1614 mLRU[idx] = id; 1601 mLRU[idx] = id;
1615 mHeaderIDMap.erase(id); 1602 mHeaderIDMap.erase(id);
@@ -1626,7 +1613,7 @@ void LLTextureCache::removeFromCache(const LLUUID& id)
1626 if (!mReadOnly) 1613 if (!mReadOnly)
1627 { 1614 {
1628 removeHeaderCacheEntry(id); 1615 removeHeaderCacheEntry(id);
1629 LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); 1616 LLAPRFile::remove(getTextureFileName(id));
1630 } 1617 }
1631} 1618}
1632 1619
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index 178fc97..3283391 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -798,7 +798,7 @@ void upload_new_resource(const std::string& src_filename, std::string name,
798 // copy this file into the vfs for upload 798 // copy this file into the vfs for upload
799 S32 file_size; 799 S32 file_size;
800 LLAPRFile infile ; 800 LLAPRFile infile ;
801 infile.open(filename, LL_APR_RB, NULL, &file_size); 801 infile.open(filename, LL_APR_RB, LLAPRFile::local, &file_size);
802 if (infile.getFileHandle()) 802 if (infile.getFileHandle())
803 { 803 {
804 LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE); 804 LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE);
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index c361f49..ab5d83e 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -8545,7 +8545,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
8545{ 8545{
8546 LLVOAvatar* avatar = gAgent.getAvatarObject(); 8546 LLVOAvatar* avatar = gAgent.getAvatarObject();
8547 LLAPRFile outfile ; 8547 LLAPRFile outfile ;
8548 outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB ); 8548 outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB, LLAPRFile::global);
8549 apr_file_t* file = outfile.getFileHandle() ; 8549 apr_file_t* file = outfile.getFileHandle() ;
8550 if( !file ) 8550 if( !file )
8551 { 8551 {
diff --git a/linden/indra/newview/primbackup.cpp b/linden/indra/newview/primbackup.cpp
index 4e0e56f..4f93ddf 100644
--- a/linden/indra/newview/primbackup.cpp
+++ b/linden/indra/newview/primbackup.cpp
@@ -1072,7 +1072,7 @@ void primbackup::upload_next_asset()
1072 S32 file_size; 1072 S32 file_size;
1073 apr_file_t* fp; 1073 apr_file_t* fp;
1074 LLAPRFile aFile; 1074 LLAPRFile aFile;
1075 aFile.open(filename, LL_APR_RB, NULL, &file_size); 1075 aFile.open(filename, LL_APR_RB, LLAPRFile::global, &file_size);
1076 fp = aFile.getFileHandle(); 1076 fp = aFile.getFileHandle();
1077 if (fp) 1077 if (fp)
1078 { 1078 {