[asterisk-commits] trunk r25716 - /trunk/indications.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 8 14:27:48 MST 2006


Author: russell
Date: Mon May  8 16:27:47 2006
New Revision: 25716

URL: http://svn.digium.com/view/asterisk?rev=25716&view=rev
Log:
remove checks of the result of ast_mutex_lock

Modified:
    trunk/indications.c

Modified: trunk/indications.c
URL: http://svn.digium.com/view/asterisk/trunk/indications.c?rev=25716&r1=25715&r2=25716&view=diff
==============================================================================
--- trunk/indications.c (original)
+++ trunk/indications.c Mon May  8 16:27:47 2006
@@ -382,10 +382,7 @@
 	if (country == NULL)
 		return 0;	/* not a single country insight */
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return 0;
-	}
+	ast_mutex_lock(&tzlock);
 	do {
 		for (tz=tone_zones; tz; tz=tz->next) {
 			if (strcasecmp(country,tz->country)==0) {
@@ -419,10 +416,7 @@
 	if (zone == NULL)
 		return 0;	/* not a single country insight */
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return 0;
-	}
+	ast_mutex_lock(&tzlock);
 	for (ts=zone->tones; ts; ts=ts->next) {
 		if (strcasecmp(indication,ts->name)==0) {
 			/* found indication! */
@@ -457,10 +451,7 @@
 {
 	struct tone_zone *tz,*pz;
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return -1;
-	}
+	ast_mutex_lock(&tzlock);
 	for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
 		if (strcasecmp(zone->country,tz->country)==0) {
 			/* tone_zone already there, replace */
@@ -498,10 +489,7 @@
 	struct tone_zone *tz, *pz = NULL, *tmp;
 	int res = -1;
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return -1;
-	}
+	ast_mutex_lock(&tzlock);
 	tz = tone_zones;
 	while (tz) {
 		if (country==NULL ||
@@ -546,10 +534,7 @@
 	if (zone->alias[0])
 		return -1;
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return -2;
-	}
+	ast_mutex_lock(&tzlock);
 	for (ps=NULL,ts=zone->tones; ts; ps=ts,ts=ts->next) {
 		if (strcasecmp(indication,ts->name)==0) {
 			/* indication already there, replace */
@@ -588,10 +573,7 @@
 	if (zone->alias[0])
 		return -1;
 
-	if (ast_mutex_lock(&tzlock)) {
-		ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
-		return -1;
-	}
+	ast_mutex_lock(&tzlock);
 	ts = zone->tones;
 	while (ts) {
 		if (strcasecmp(indication,ts->name)==0) {



More information about the asterisk-commits mailing list