summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-04-25 22:00:35 +0000
committerRussell Bryant <russell@russellbryant.com>2008-04-25 22:00:35 +0000
commit7be171455df9f9e8c546404f8e74b24387db3bf1 (patch)
treec19673d14c0efffa7dd4397922950d07e000d611 /channels
parent463a5dbd0a76c80e40c55c8883074e3db0807908 (diff)
Merged revisions 114673 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114673 | russell | 2008-04-25 16:54:40 -0500 (Fri, 25 Apr 2008) | 3 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@114674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 2d5320537..3c12a802a 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1499,7 +1499,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
char host[80];
if (new <= NEW_ALLOW) {
- 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 */
@@ -1507,10 +1507,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 */
@@ -1518,11 +1518,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