summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/errno.c
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2011-03-16 07:34:16 +0000
committerNanang Izzuddin <nanang@teluu.com>2011-03-16 07:34:16 +0000
commit2a9988f3e4c9b8d40ffebaa4427908de29324711 (patch)
tree0fec17a1ff6201f61e16e3bb03821c62080be372 /pjlib/src/pj/errno.c
parente8673ffff74a0e9a63ce789e884a98a369bc8cc3 (diff)
Fix #1212:
- Updated pj_register_strerror() to just return PJ_SUCCESS when the same range and handler is being re-registered. - Removed the usage of static flag of error string handler registration in some modules, which prevent the re-registration of the handler, e.g: in restarting pjsua, as such flags never got reseted. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3455 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/errno.c')
-rw-r--r--pjlib/src/pj/errno.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index e36b3266..40ac9779 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -128,6 +128,14 @@ PJ_DEF(pj_status_t) pj_register_strerror( pj_status_t start,
if (IN_RANGE(start, err_msg_hnd[i].begin, err_msg_hnd[i].end) ||
IN_RANGE(start+space-1, err_msg_hnd[i].begin, err_msg_hnd[i].end))
{
+ if (err_msg_hnd[i].begin == start &&
+ err_msg_hnd[i].end == (start+space) &&
+ err_msg_hnd[i].strerror == f)
+ {
+ /* The same range and handler has already been registered */
+ return PJ_SUCCESS;
+ }
+
return PJ_EEXISTS;
}
}