More select/poll updates for various applications

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-04-26 03:02:49 +00:00
parent 459fda5e44
commit ce44c6ec41
6 changed files with 31 additions and 22 deletions

View File

@@ -61,7 +61,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;
struct pollfd fds[1];
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
if (option_debug)
ast_log(LOG_DEBUG, "Entered Wil-Calu fd=%d\n",fd);
@@ -77,9 +77,9 @@ 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);
fds[0].fd = fd;
fds[0].events = POLLIN;
poll(fds, 1, -1);
bytes=read(fd,buf,256);
buf[(int)bytes]=0;