[asterisk-commits] tilghman: trunk r70610 - in /trunk: apps/app_queue.c main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 20 18:31:09 CDT 2007


Author: tilghman
Date: Wed Jun 20 18:31:08 2007
New Revision: 70610

URL: http://svn.digium.com/view/asterisk?view=rev&rev=70610
Log:
Fix trunk brokenness; also, optimize application registration

Modified:
    trunk/apps/app_queue.c
    trunk/main/pbx.c

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=70610&r1=70609&r2=70610
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Jun 20 18:31:08 2007
@@ -4808,7 +4808,7 @@
 	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END)))
 		res = -1;
 
-	return res;
+	return res ? AST_MODULE_LOAD_DECLINE : 0;
 }
 
 static int reload(void)

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=70610&r1=70609&r2=70610
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Jun 20 18:31:08 2007
@@ -2940,15 +2940,16 @@
 {
 	struct ast_app *tmp, *cur = NULL;
 	char tmps[80];
-	int length;
+	int length, res;
 
 	AST_RWLIST_WRLOCK(&apps);
 	AST_RWLIST_TRAVERSE(&apps, tmp, list) {
-		if (!strcasecmp(app, tmp->name)) {
+		if (!(res = strcasecmp(app, tmp->name))) {
 			ast_log(LOG_WARNING, "Already have an application '%s'\n", app);
 			AST_RWLIST_UNLOCK(&apps);
 			return -1;
-		}
+		} else if (res < 0)
+			break;
 	}
 
 	length = sizeof(*tmp) + strlen(app) + 1;




More information about the asterisk-commits mailing list