summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsys.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2012-01-20 15:40:43 -0500
committerDebi King (Dessie) <dessie@lindenlab.com>2012-01-20 15:40:43 -0500
commit6298daf266369dbd3600c5fdf287f9c680b2a897 (patch)
tree270a7d6d12e444d739b85ad9d89e0001621b20a2 /indra/llcommon/llsys.cpp
parent7c0b98aa83faacf27da2b71e186399e232a1a376 (diff)
parent0915ce7834f8e36c53e0790c2946b952a12a74c6 (diff)
merge
Diffstat (limited to 'indra/llcommon/llsys.cpp')
-rw-r--r--indra/llcommon/llsys.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index d781687175..6073bcd0a6 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -608,6 +608,7 @@ LLCPUInfo::LLCPUInfo()
out << " (" << mCPUMHz << " MHz)";
}
mCPUString = out.str();
+ LLStringUtil::trim(mCPUString);
}
bool LLCPUInfo::hasAltivec() const
@@ -1363,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