diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-28 01:44:40 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-28 01:44:40 +0000 |
commit | 6466e3002fa7975e71746db68a1486320982931e (patch) | |
tree | 6802d212784f98d00789e0f452bac3d708578df1 /pbx | |
parent | e643d45303498cc1d533c1f203553ba2442b3fc0 (diff) |
Make wilcalu non-blocking
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@922 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_wilcalu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pbx/pbx_wilcalu.c b/pbx/pbx_wilcalu.c index 134ce6bb6..c14e39526 100755 --- a/pbx/pbx_wilcalu.c +++ b/pbx/pbx_wilcalu.c @@ -58,7 +58,9 @@ static void *autodial(void *ignore) { pthread_t dialstring_thread; char * sendbufptr=sendbuf; - int fd=open(dialfile,O_RDONLY); + int fd=open(dialfile,O_RDONLY|O_NONBLOCK); + int flags = fcntl(fd, F_GETFL); + fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); printf("Entered Wil-Calu fd=%d\n",fd); if(fd<0) { printf("Autodial: Unable to open file\n"); @@ -75,7 +77,7 @@ static void *autodial(void *ignore) bytes=read(fd,buf,256); buf[(int)bytes]=0; - if(bytes){ + if(bytes>0){ int x; printf("WilCalu : Read Buf %s\n",buf); sendbufptr=sendbuf; |