mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 08:44:14 +00:00
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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user