diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-21 23:44:18 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-21 23:44:18 +0000 |
commit | 9973012507e5ae4de145b3cfd0904e02d937752b (patch) | |
tree | 00654c22c421a9609fc8d8b3b979d6f3c869ac2d /channels | |
parent | e0f67458b9315bc7adc98c8d1c0a300d591cb897 (diff) |
Merged revisions 139391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r139391 | jpeeler | 2008-08-21 18:41:50 -0500 (Thu, 21 Aug 2008) | 11 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.1@139399 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 92c0a1619..8c2bd8ebb 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -8334,12 +8334,14 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, int chan_sig = conf->chan.sig; if (!here) { if ((channel != CHAN_PSEUDO) && !pri) { + int count = 0; snprintf(fn, sizeof(fn), "%d", channel); /* Open non-blocking */ 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); tmp->subs[SUB_REAL].dfd = dahdi_open(fn); + count++; } /* Allocate a DAHDI structure */ if (tmp->subs[SUB_REAL].dfd < 0) { |