summaryrefslogtreecommitdiff
path: root/indra/llimage/llimage.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2009-02-18 21:10:16 +0000
committerBrad Kittenbrink <brad@lindenlab.com>2009-02-18 21:10:16 +0000
commitabdc99f21b542c4fea67030ddbd7166c9d1c6c63 (patch)
tree3e984e405adfdec189ca8a047daca5250737ffbf /indra/llimage/llimage.cpp
parent34412f0530cf6a411b4de906a8e9da59cbcb3a85 (diff)
Merge of QAR-1267 to trunk. This was a combo merge of QAR-1175 (maint-render-9) and QAR-1236 (dll-msvcrt-2)
svn merge -r 109838:112264 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-render/maint-render-9-merge-r109833
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rw-r--r--indra/llimage/llimage.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index bfa129ea1d..88edc9943c 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1513,7 +1513,9 @@ BOOL LLImageFormatted::load(const std::string &filename)
resetLastError();
S32 file_size = 0;
- apr_file_t* apr_file = ll_apr_file_open(filename, LL_APR_RB, &file_size);
+ LLAPRFile infile ;
+ infile.open(filename, LL_APR_RB, NULL, &file_size);
+ apr_file_t* apr_file = infile.getFileHandle();
if (!apr_file)
{
setLastError("Unable to open file for reading", filename);
@@ -1522,7 +1524,6 @@ BOOL LLImageFormatted::load(const std::string &filename)
if (file_size == 0)
{
setLastError("File is empty",filename);
- apr_file_close(apr_file);
return FALSE;
}
@@ -1540,8 +1541,7 @@ BOOL LLImageFormatted::load(const std::string &filename)
{
res = updateData();
}
- apr_file_close(apr_file);
-
+
return res;
}
@@ -1549,16 +1549,16 @@ BOOL LLImageFormatted::save(const std::string &filename)
{
resetLastError();
- apr_file_t* apr_file = ll_apr_file_open(filename, LL_APR_WB);
- if (!apr_file)
+ LLAPRFile outfile ;
+ outfile.open(filename, LL_APR_WB);
+ if (!outfile.getFileHandle())
{
setLastError("Unable to open file for writing", filename);
return FALSE;
}
- ll_apr_file_write(apr_file, getData(), getDataSize());
- apr_file_close(apr_file);
-
+ outfile.write(getData(), getDataSize());
+ outfile.close() ;
return TRUE;
}