]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix timeout > 600000 on Linux x86-32
authorMark Spencer <markster@digium.com>
Thu, 20 Oct 2005 22:45:47 +0000 (22:45 +0000)
committerMark Spencer <markster@digium.com>
Thu, 20 Oct 2005 22:45:47 +0000 (22:45 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6836 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index 655bac85f6e3fdcddb883bdf70e3f7e0153ffa8c..dbfc98c5c2cd478d17d535a942503c25f417ee6c 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -1325,7 +1325,20 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
        }
        if (*ms > 0) 
                start = ast_tvnow();
-       res = poll(pfds, max, rms);
+       
+       if (sizeof(int) == 4) {
+               do {
+                       int kbrms = rms;
+                       if (kbrms > 600000)
+                               kbrms = 600000;
+                       res = poll(pfds, max, kbrms);
+                       if (!res)
+                               rms -= kbrms;
+               } while (!res && (rms > 0));
+       } else {
+               res = poll(pfds, max, rms);
+       }
+       
        if (res < 0) {
                for (x=0; x < n; x++) 
                        ast_clear_flag(c[x], AST_FLAG_BLOCKING);