mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-23 04:58:48 +00:00
Merged revisions 139387 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r139387 | jpeeler | 2008-08-21 18:39:31 -0500 (Thu, 21 Aug 2008) | 3 lines Fixes loop that could possibly never exit in the event of a channel never being able to be opened or specify after a restart. (closes issue #11017) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -8334,12 +8334,14 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
|
|||||||
int chan_sig = conf->chan.sig;
|
int chan_sig = conf->chan.sig;
|
||||||
if (!here) {
|
if (!here) {
|
||||||
if ((channel != CHAN_PSEUDO) && !pri) {
|
if ((channel != CHAN_PSEUDO) && !pri) {
|
||||||
|
int count = 0;
|
||||||
snprintf(fn, sizeof(fn), "%d", channel);
|
snprintf(fn, sizeof(fn), "%d", channel);
|
||||||
/* Open non-blocking */
|
/* Open non-blocking */
|
||||||
tmp->subs[SUB_REAL].dfd = dahdi_open(fn);
|
tmp->subs[SUB_REAL].dfd = dahdi_open(fn);
|
||||||
while (tmp->subs[SUB_REAL].dfd < 0 && reloading == 2) { /* the kernel may not call dahdi_release fast enough for the open flagbit to be cleared in time */
|
while (tmp->subs[SUB_REAL].dfd < 0 && reloading == 2 && count < 1000) { /* the kernel may not call dahdi_release fast enough for the open flagbit to be cleared in time */
|
||||||
usleep(1);
|
usleep(1);
|
||||||
tmp->subs[SUB_REAL].dfd = dahdi_open(fn);
|
tmp->subs[SUB_REAL].dfd = dahdi_open(fn);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
/* Allocate a DAHDI structure */
|
/* Allocate a DAHDI structure */
|
||||||
if (tmp->subs[SUB_REAL].dfd < 0) {
|
if (tmp->subs[SUB_REAL].dfd < 0) {
|
||||||
|
Reference in New Issue
Block a user