[Asterisk-bsd] O_NONBLOCK in app_dahdiscan.c

Michel Seliverstoff michel at seliverstoff.fr
Mon Apr 12 11:10:58 CDT 2010


Am I posting the wrong place?

Michel Seliverstoff wrote:
> Hello,
> is it possible to change apps/app_dahdiscan.c line fd = 
> open(DAHDI_FILE_PSEUDO, O_RDWR); somehow setting the O_NONBLOCK flag 
> after opening the file doesn't work on freebsd 7.2.
> Thanks,
> Michel
>
> --- apps/app_dahdiscan.orig 2008-12-19 14:48:00.000000000 -0500
> +++ apps/app_dahdiscan.c    2009-12-04 10:41:27.000000000 -0500
> @@ -135,23 +135,11 @@
>   zapretry:
>     origfd = chan->fds[0];
>     if (retryzap) {
> -       fd = open(DAHDI_FILE_PSEUDO, O_RDWR);
> +       fd = open(DAHDI_FILE_PSEUDO, O_RDWR | O_NONBLOCK);
>         if (fd < 0) {
>             ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", 
> strerror(errno));
>             goto outrun;
>         }
> -       /* Make non-blocking */
> -       flags = fcntl(fd, F_GETFL);
> -       if (flags < 0) {
> -           ast_log(LOG_WARNING, "Unable to get flags: %s\n", 
> strerror(errno));
> -           close(fd);
> -                        goto outrun;
> -       }
> -       if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
> -           ast_log(LOG_WARNING, "Unable to set flags: %s\n", 
> strerror(errno));
> -           close(fd);
> -           goto outrun;
> -       }
>         /* Setup buffering information */
>         memset(&bi, 0, sizeof(bi));
>         bi.bufsize = CONF_SIZE;
>
>
>
>   



More information about the Asterisk-BSD mailing list