mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
remove checks of the result of ast_mutex_lock
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -382,10 +382,7 @@ struct tone_zone *ast_get_indication_zone(const char *country)
|
|||||||
if (country == NULL)
|
if (country == NULL)
|
||||||
return 0; /* not a single country insight */
|
return 0; /* not a single country insight */
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
for (tz=tone_zones; tz; tz=tz->next) {
|
for (tz=tone_zones; tz; tz=tz->next) {
|
||||||
if (strcasecmp(country,tz->country)==0) {
|
if (strcasecmp(country,tz->country)==0) {
|
||||||
@@ -419,10 +416,7 @@ struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, co
|
|||||||
if (zone == NULL)
|
if (zone == NULL)
|
||||||
return 0; /* not a single country insight */
|
return 0; /* not a single country insight */
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
for (ts=zone->tones; ts; ts=ts->next) {
|
for (ts=zone->tones; ts; ts=ts->next) {
|
||||||
if (strcasecmp(indication,ts->name)==0) {
|
if (strcasecmp(indication,ts->name)==0) {
|
||||||
/* found indication! */
|
/* found indication! */
|
||||||
@@ -457,10 +451,7 @@ int ast_register_indication_country(struct tone_zone *zone)
|
|||||||
{
|
{
|
||||||
struct tone_zone *tz,*pz;
|
struct tone_zone *tz,*pz;
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
|
for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
|
||||||
if (strcasecmp(zone->country,tz->country)==0) {
|
if (strcasecmp(zone->country,tz->country)==0) {
|
||||||
/* tone_zone already there, replace */
|
/* tone_zone already there, replace */
|
||||||
@@ -498,10 +489,7 @@ int ast_unregister_indication_country(const char *country)
|
|||||||
struct tone_zone *tz, *pz = NULL, *tmp;
|
struct tone_zone *tz, *pz = NULL, *tmp;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
tz = tone_zones;
|
tz = tone_zones;
|
||||||
while (tz) {
|
while (tz) {
|
||||||
if (country==NULL ||
|
if (country==NULL ||
|
||||||
@@ -546,10 +534,7 @@ int ast_register_indication(struct tone_zone *zone, const char *indication, cons
|
|||||||
if (zone->alias[0])
|
if (zone->alias[0])
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
for (ps=NULL,ts=zone->tones; ts; ps=ts,ts=ts->next) {
|
for (ps=NULL,ts=zone->tones; ts; ps=ts,ts=ts->next) {
|
||||||
if (strcasecmp(indication,ts->name)==0) {
|
if (strcasecmp(indication,ts->name)==0) {
|
||||||
/* indication already there, replace */
|
/* indication already there, replace */
|
||||||
@@ -588,10 +573,7 @@ int ast_unregister_indication(struct tone_zone *zone, const char *indication)
|
|||||||
if (zone->alias[0])
|
if (zone->alias[0])
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (ast_mutex_lock(&tzlock)) {
|
ast_mutex_lock(&tzlock);
|
||||||
ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ts = zone->tones;
|
ts = zone->tones;
|
||||||
while (ts) {
|
while (ts) {
|
||||||
if (strcasecmp(indication,ts->name)==0) {
|
if (strcasecmp(indication,ts->name)==0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user