EXP-1525 FIXED Potential fix for a crash at shutdown: added some error handling to saving inventory cache.

master
Vadim ProductEngine 2012-01-10 16:35:36 +02:00
parent c4a08e6c9d
commit a47e9bd97b
2 changed files with 15 additions and 4 deletions

View File

@ -1364,11 +1364,21 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */
if (! src) goto err;
do
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
{
bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE,src);
gzwrite(dst, buffer, bytes);
} while(feof(src) == 0);
if (gzwrite(dst, buffer, bytes) <= 0)
{
llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl;
goto err;
}
}
if (ferror(src))
{
llwarns << "Error reading " << srcfile << llendl;
goto err;
}
gzclose(dst);
dst = NULL;
#if LL_WINDOWS

View File

@ -64,6 +64,7 @@ class LLInventoryCollectFunctor;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLInventoryModel
{
LOG_CLASS(LLInventoryModel);
public:
friend class LLInventoryModelFetchDescendentsResponder;