aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-25 21:54:40 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-25 21:54:40 +0000
commit966b1e3d853106be5d437cd399df5bfb3f2bc581 (patch)
treeffac2fcd13cb0882264d9209fd71009c7fe7f7cc /channels
parent7f573b8a61ddf0445ebeb3e43c3c3374c13d9624 (diff)
Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114673 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index d44163e22..a949a1c50 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1345,7 +1345,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
if (new <= NEW_ALLOW) {
/* Look for an existing connection first */
- for (x=1;(res < 1) && (x<maxnontrunkcall);x++) {
+ for (x = 1; !res && x < maxnontrunkcall; x++) {
ast_mutex_lock(&iaxsl[x]);
if (iaxs[x]) {
/* Look for an exact match */
@@ -1353,10 +1353,10 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
res = x;
}
}
- if (!res || (res && !return_locked))
+ if (!res || !return_locked)
ast_mutex_unlock(&iaxsl[x]);
}
- for (x=TRUNK_CALL_START;(res < 1) && (x<maxtrunkcall);x++) {
+ for (x = TRUNK_CALL_START; !res && x < maxtrunkcall; x++) {
ast_mutex_lock(&iaxsl[x]);
if (iaxs[x]) {
/* Look for an exact match */
@@ -1364,11 +1364,11 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
res = x;
}
}
- if (!res || (res && !return_locked))
+ if (!res || !return_locked)
ast_mutex_unlock(&iaxsl[x]);
}
}
- if ((res < 1) && (new >= NEW_ALLOW)) {
+ if (!res && (new >= NEW_ALLOW)) {
int start, found = 0;
/* It may seem odd that we look through the peer list for a name for