aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--linden/indra/llcommon/llapr.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/linden/indra/llcommon/llapr.cpp b/linden/indra/llcommon/llapr.cpp
index a013d9c..1040671 100644
--- a/linden/indra/llcommon/llapr.cpp
+++ b/linden/indra/llcommon/llapr.cpp
@@ -82,7 +82,7 @@ bool ll_apr_warn_status(apr_status_t status)
82 if(APR_SUCCESS == status) return false; 82 if(APR_SUCCESS == status) return false;
83 char buf[MAX_STRING]; /* Flawfinder: ignore */ 83 char buf[MAX_STRING]; /* Flawfinder: ignore */
84 apr_strerror(status, buf, MAX_STRING); 84 apr_strerror(status, buf, MAX_STRING);
85 LL_WARNS("APR") << "APR: " << buf << LL_ENDL; 85 LL_WARNS("APR") << "APR: " << buf << " (" << status << ")" << LL_ENDL;
86 return true; 86 return true;
87} 87}
88 88
@@ -194,8 +194,12 @@ apr_status_t LLAPRFile::open(std::string const& filename, apr_int32_t flags, acc
194// File I/O 194// File I/O
195S32 LLAPRFile::read(void *buf, S32 nbytes) 195S32 LLAPRFile::read(void *buf, S32 nbytes)
196{ 196{
197 llassert_always(mFile) ; 197 if(!mFile)
198 198 {
199 llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
200 return 0;
201 }
202
199 apr_size_t sz = nbytes; 203 apr_size_t sz = nbytes;
200 apr_status_t s = apr_file_read(mFile, buf, &sz); 204 apr_status_t s = apr_file_read(mFile, buf, &sz);
201 if (s != APR_SUCCESS) 205 if (s != APR_SUCCESS)
@@ -212,7 +216,11 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
212 216
213S32 LLAPRFile::write(const void *buf, S32 nbytes) 217S32 LLAPRFile::write(const void *buf, S32 nbytes)
214{ 218{
215 llassert_always(mFile) ; 219 if(!mFile)
220 {
221 llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
222 return 0;
223 }
216 224
217 apr_size_t sz = nbytes; 225 apr_size_t sz = nbytes;
218 apr_status_t s = apr_file_write(mFile, buf, &sz); 226 apr_status_t s = apr_file_write(mFile, buf, &sz);