[asterisk-commits] kmoore: branch kmoore/stasis-bridging-channel_events r385815 - /team/kmoore/s...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 15 14:50:34 CDT 2013
Author: kmoore
Date: Mon Apr 15 14:50:31 2013
New Revision: 385815
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385815
Log:
Make sure the module fails to load if init fails
Modified:
team/kmoore/stasis-bridging-channel_events/res/res_stasis.c
Modified: team/kmoore/stasis-bridging-channel_events/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/res/res_stasis.c?view=diff&rev=385815&r1=385814&r2=385815
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/res/res_stasis.c (original)
+++ team/kmoore/stasis-bridging-channel_events/res/res_stasis.c Mon Apr 15 14:50:31 2013
@@ -894,6 +894,9 @@
}
blob_handlers = ao2_container_alloc(BLOB_HANDLER_BUCKETS, blob_handler_hash, blob_handler_cmp);
+ if (!blob_handlers) {
+ return AST_MODULE_LOAD_FAILURE;
+ }
register_blob_handler("userevent", handle_blob_generic);
register_blob_handler("hangup_request", handle_blob_generic);
@@ -907,8 +910,11 @@
r |= stasis_message_router_add(app_channel_router, stasis_cache_update_type(), sub_snapshot_handler, NULL);
r |= stasis_message_router_add(app_channel_router, ast_channel_blob_type(), sub_blob_handler, NULL);
-
- return r;
+ if (r) {
+ return AST_MODULE_LOAD_FAILURE;
+ }
+
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
More information about the asterisk-commits
mailing list