summaryrefslogtreecommitdiff
path: root/indra/llcommon/llapr.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2010-12-23 19:41:44 -0500
committerOz Linden <oz@lindenlab.com>2010-12-23 19:41:44 -0500
commit5a4bb72b8d37ca51deb84e1490fdefe2908d2d59 (patch)
tree9a22b0583bb290a242df3c619665fdb692e1ecef /indra/llcommon/llapr.cpp
parent86380bb177b9e18e345bc302efb3a84b2c5758a9 (diff)
parent49de8add8355455da4b6ec5aaa55427fafa94322 (diff)
Automated merge with ssh://bitbucket.org/aleric/viewer-development-aleric-export
Diffstat (limited to 'indra/llcommon/llapr.cpp')
-rw-r--r--indra/llcommon/llapr.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp
index 66ec5bad2c..d1c44c9403 100644
--- a/indra/llcommon/llapr.cpp
+++ b/indra/llcommon/llapr.cpp
@@ -28,6 +28,7 @@
#include "linden_common.h"
#include "llapr.h"
+#include "apr_dso.h"
apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool
LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool.
@@ -279,14 +280,31 @@ bool ll_apr_warn_status(apr_status_t status)
{
if(APR_SUCCESS == status) return false;
char buf[MAX_STRING]; /* Flawfinder: ignore */
- apr_strerror(status, buf, MAX_STRING);
+ apr_strerror(status, buf, sizeof(buf));
LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
return true;
}
+bool ll_apr_warn_status(apr_status_t status, apr_dso_handle_t *handle)
+{
+ bool result = ll_apr_warn_status(status);
+ // Despite observed truncation of actual Mac dylib load errors, increasing
+ // this buffer to more than MAX_STRING doesn't help: it appears that APR
+ // stores the output in a fixed 255-character internal buffer. (*sigh*)
+ char buf[MAX_STRING]; /* Flawfinder: ignore */
+ apr_dso_error(handle, buf, sizeof(buf));
+ LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
+ return result;
+}
+
void ll_apr_assert_status(apr_status_t status)
{
- llassert(ll_apr_warn_status(status) == false);
+ llassert(! ll_apr_warn_status(status));
+}
+
+void ll_apr_assert_status(apr_status_t status, apr_dso_handle_t *handle)
+{
+ llassert(! ll_apr_warn_status(status, handle));
}
//---------------------------------------------------------------------