[svn-commits] seanbright: branch group/newcdr r202107 - /team/group/newcdr/cel/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 19 19:07:48 CDT 2009


Author: seanbright
Date: Fri Jun 19 19:07:44 2009
New Revision: 202107

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202107
Log:
Initialize event_sub to NULL instead of 0, and assign the result of
ast_event_unsubscribe to event_sub instead of setting it separately.

Modified:
    team/group/newcdr/cel/cel_adaptive_odbc.c
    team/group/newcdr/cel/cel_manager.c
    team/group/newcdr/cel/cel_pgsql.c
    team/group/newcdr/cel/cel_radius.c
    team/group/newcdr/cel/cel_sqlite3_custom.c
    team/group/newcdr/cel/cel_tds.c

Modified: team/group/newcdr/cel/cel_adaptive_odbc.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_adaptive_odbc.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_adaptive_odbc.c (original)
+++ team/group/newcdr/cel/cel_adaptive_odbc.c Fri Jun 19 19:07:44 2009
@@ -51,7 +51,7 @@
 #include "asterisk/module.h"
 
 #define	CONFIG	"cel_adaptive_odbc.conf"
-static struct ast_event_sub *event_sub = 0;
+static struct ast_event_sub *event_sub = NULL;
 
 /* Optimization to reduce number of memory allocations */
 static int maxsize = 512, maxsize2 = 512;
@@ -718,9 +718,8 @@
 static int unload_module(void)
 {
 	if (event_sub) {
-		ast_event_unsubscribe(event_sub);
-	}
-	event_sub = 0;
+		event_sub = ast_event_unsubscribe(event_sub);
+	}
 	usleep(1);
 	if (AST_RWLIST_WRLOCK(&odbc_tables)) {
 		event_sub = ast_event_subscribe(AST_EVENT_CEL, odbc_log, "Adaptive ODBC CEL backend", NULL, AST_EVENT_IE_END);

Modified: team/group/newcdr/cel/cel_manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_manager.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_manager.c (original)
+++ team/group/newcdr/cel/cel_manager.c Fri Jun 19 19:07:44 2009
@@ -119,9 +119,8 @@
 
 	if (enablecel && !newenablecel) {
 		if (event_sub) {
-			ast_event_unsubscribe(event_sub);
-		}
-		event_sub = NULL;
+			event_sub = ast_event_unsubscribe(event_sub);
+		}
 	} else if (!enablecel && newenablecel) {
 		event_sub = ast_event_subscribe(AST_EVENT_CEL, manager_log, "Manager Event Logging", NULL, AST_EVENT_IE_END);
 		if (!event_sub) {
@@ -187,13 +186,12 @@
 static int unload_module(void)
 {
 	if (event_sub) {
-		ast_event_unsubscribe(event_sub);
+		event_sub = ast_event_unsubscribe(event_sub);
 	}
 	if (customfields) {
 		ast_free(customfields);
 	}
 	customfields = NULL;
-	event_sub = NULL;
 	return 0;
 }
 

Modified: team/group/newcdr/cel/cel_pgsql.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_pgsql.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_pgsql.c (original)
+++ team/group/newcdr/cel/cel_pgsql.c Fri Jun 19 19:07:44 2009
@@ -73,7 +73,7 @@
 
 static PGconn	*conn = NULL;
 static PGresult	*result = NULL;
-static struct ast_event_sub *event_sub = 0;
+static struct ast_event_sub *event_sub = NULL;
 
 struct columns {
         char *name;
@@ -338,9 +338,8 @@
 	/* Give all threads time to finish */
 	usleep(1);
 	if (event_sub) {
-		ast_event_unsubscribe(event_sub);
-	}
-	event_sub = NULL;
+		event_sub = ast_event_unsubscribe(event_sub);
+	}
 	if (conn) {
 		PQfinish(conn);
 	}

Modified: team/group/newcdr/cel/cel_radius.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_radius.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_radius.c (original)
+++ team/group/newcdr/cel/cel_radius.c Fri Jun 19 19:07:44 2009
@@ -90,7 +90,7 @@
 static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD };
 
 static rc_handle *rh = NULL;
-static struct ast_event_sub *event_sub = 0;
+static struct ast_event_sub *event_sub = NULL;
 
 #define ADD_VENDOR_CODE(x,y) (rc_avpair_add(rh, send, x, &y, strlen(y), VENDOR_CODE))
 
@@ -212,9 +212,8 @@
 static int unload_module(void)
 {
 	if (event_sub) {
-		ast_event_unsubscribe(event_sub);
-	}
-	event_sub = 0;
+		event_sub = ast_event_unsubscribe(event_sub);
+	}
 	return AST_MODULE_LOAD_SUCCESS;
 }
 

Modified: team/group/newcdr/cel/cel_sqlite3_custom.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_sqlite3_custom.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_sqlite3_custom.c (original)
+++ team/group/newcdr/cel/cel_sqlite3_custom.c Fri Jun 19 19:07:44 2009
@@ -65,7 +65,7 @@
 
 static char table[80];
 static char *columns;
-static struct ast_event_sub *event_sub = 0;
+static struct ast_event_sub *event_sub = NULL;
 
 struct values {
 	char *expression;

Modified: team/group/newcdr/cel/cel_tds.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_tds.c?view=diff&rev=202107&r1=202106&r2=202107
==============================================================================
--- team/group/newcdr/cel/cel_tds.c (original)
+++ team/group/newcdr/cel/cel_tds.c Fri Jun 19 19:07:44 2009
@@ -82,7 +82,7 @@
 
 static char *config = "cel_tds.conf";
 
-static struct ast_event_sub *event_sub = 0;
+static struct ast_event_sub *event_sub = NULL;
 
 struct cel_tds_config {
 	AST_DECLARE_STRING_FIELDS(
@@ -389,9 +389,8 @@
 static int tds_unload_module(void)
 {
 	if (event_sub) {
-		ast_event_unsubscribe(event_sub);
-	}
-	event_sub = 0;
+		event_sub = ast_event_unsubscribe(event_sub);
+	}
 
 	if (settings) {
 		ast_mutex_lock(&tds_lock);




More information about the svn-commits mailing list