[asterisk-commits] rmudgett: branch group/bridge_construction r385379 - in /team/group/bridge_co...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 11 16:46:17 CDT 2013


Author: rmudgett
Date: Thu Apr 11 16:46:14 2013
New Revision: 385379

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385379
Log:
Make ast_stasis_bridging_init() return failure condition.

Modified:
    team/group/bridge_construction/include/asterisk/stasis_bridging.h
    team/group/bridge_construction/main/bridging.c
    team/group/bridge_construction/main/stasis_bridging.c

Modified: team/group/bridge_construction/include/asterisk/stasis_bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/include/asterisk/stasis_bridging.h?view=diff&rev=385379&r1=385378&r2=385379
==============================================================================
--- team/group/bridge_construction/include/asterisk/stasis_bridging.h (original)
+++ team/group/bridge_construction/include/asterisk/stasis_bridging.h Thu Apr 11 16:46:14 2013
@@ -210,8 +210,10 @@
 
 /*!
  * \brief Initialize the stasis bridging topic and message types
- */
-void ast_stasis_bridging_init(void);
+ * \retval 0 on success
+ * \retval -1 on failure
+ */
+int ast_stasis_bridging_init(void);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/group/bridge_construction/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/main/bridging.c?view=diff&rev=385379&r1=385378&r2=385379
==============================================================================
--- team/group/bridge_construction/main/bridging.c (original)
+++ team/group/bridge_construction/main/bridging.c Thu Apr 11 16:46:14 2013
@@ -4073,13 +4073,16 @@
 
 int ast_bridging_init(void)
 {
+	if (ast_stasis_bridging_init()) {
+		bridge_shutdown();
+		return -1;
+	}
+
 	bridge_manager = bridge_manager_create();
 	if (!bridge_manager) {
 		return -1;
 	}
 
-	ast_stasis_bridging_init();
-
 	ast_register_atexit(bridge_shutdown);
 	return 0;
 }

Modified: team/group/bridge_construction/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/main/stasis_bridging.c?view=diff&rev=385379&r1=385378&r2=385379
==============================================================================
--- team/group/bridge_construction/main/stasis_bridging.c (original)
+++ team/group/bridge_construction/main/stasis_bridging.c Thu Apr 11 16:46:14 2013
@@ -339,7 +339,7 @@
 	return snapshot->uniqueid;
 }
 
-void ast_stasis_bridging_init(void)
+int ast_stasis_bridging_init(void)
 {
 	bridge_snapshot_type = stasis_message_type_create("ast_bridge_snapshot");
 	bridge_blob_type = stasis_message_type_create("ast_bridge_blob");
@@ -347,4 +347,10 @@
 	bridge_topic_all = stasis_topic_create("ast_bridge_topic_all");
 	bridge_topic_all_cached = stasis_caching_topic_create(bridge_topic_all, bridge_snapshot_get_id);
 	bridge_topic_pool = stasis_topic_pool_create(bridge_topic_all);
-}
+	return !bridge_snapshot_type
+		|| !bridge_blob_type
+		|| !bridge_merge_message_type
+		|| !bridge_topic_all
+		|| !bridge_topic_all_cached
+		|| !bridge_topic_pool ? -1 : 0;
+}




More information about the asterisk-commits mailing list