diff options
author | McCabe Maxsted | 2011-07-05 14:06:40 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-07-05 14:06:40 -0700 |
commit | 5fb019a522c276d18fb632de66d52f56439f65e4 (patch) | |
tree | 5da73c57cdedb96c7a69cb66e63fba8251f6b5b7 /linden | |
parent | Fixed #986: Preferences->Graphics Advanced Options checkbox is not available ... (diff) | |
download | meta-impy-5fb019a522c276d18fb632de66d52f56439f65e4.zip meta-impy-5fb019a522c276d18fb632de66d52f56439f65e4.tar.gz meta-impy-5fb019a522c276d18fb632de66d52f56439f65e4.tar.bz2 meta-impy-5fb019a522c276d18fb632de66d52f56439f65e4.tar.xz |
return 0 when mFile isn't found in llapr rather than asserting always
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/llcommon/llapr.cpp | 16 |
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 |
195 | S32 LLAPRFile::read(void *buf, S32 nbytes) | 195 | S32 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 | ||
213 | S32 LLAPRFile::write(const void *buf, S32 nbytes) | 217 | S32 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); |