aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-28 19:58:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-28 19:58:43 +0000
commitcdcc0356202a00cdca21c989b71fe7376d81a895 (patch)
tree231c2b4a80176683c909285164d9ec0c8e8d58e5 /pbx
parent17d587b621e47b46e4a4d92ce2b3709e5255f3f4 (diff)
Fix pbx_wilcalu from occupying 100% CPU now that it's nonblocking, and add malloc debug
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@927 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/pbx_wilcalu.c5
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){