diff options
author | Mark Spencer <markster@digium.com> | 2003-04-28 19:58:43 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-04-28 19:58:43 +0000 |
commit | 209a6d00f3d3007589c18d8e361e20bd3ce964b9 (patch) | |
tree | 231c2b4a80176683c909285164d9ec0c8e8d58e5 /pbx | |
parent | 5526000ecea9f6df4444818ba633a0d27ab673e5 (diff) |
Fix pbx_wilcalu from occupying 100% CPU now that it's nonblocking, and add malloc debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_wilcalu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pbx/pbx_wilcalu.c b/pbx/pbx_wilcalu.c index c14e39526..8995491a8 100755 --- a/pbx/pbx_wilcalu.c +++ b/pbx/pbx_wilcalu.c @@ -60,6 +60,7 @@ static void *autodial(void *ignore) char * sendbufptr=sendbuf; int fd=open(dialfile,O_RDONLY|O_NONBLOCK); int flags = fcntl(fd, F_GETFL); + fd_set fds; fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); printf("Entered Wil-Calu fd=%d\n",fd); if(fd<0) { @@ -74,7 +75,11 @@ static void *autodial(void *ignore) void *pass; memset(buf,0,257); + FD_ZERO(&fds); + FD_SET(fd, &fds); + ast_select(fd + 1, &fds, NULL, NULL, NULL); bytes=read(fd,buf,256); + printf("Bytes: %d\n", bytes); buf[(int)bytes]=0; if(bytes>0){ |