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;
>
>
>
>   

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Asterisk-BSD mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-bsd

Reply via email to