mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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){
|
||||
|
Reference in New Issue
Block a user