Hi,

Here's two patches to address this, one for usbi_pipe and one for darwin.

Note that return value checking is not being done in Darwin and I wasn't
sure exactly how to handle it, so I'll leave that up to Nathan.

Regards,
Chris


On Fri, Jun 14, 2013 at 7:33 AM, Nathan Hjelm <hje...@mac.com> wrote:

>
>
> On Jun 14, 2013, at 02:58 AM, Hans de Goede <hdego...@redhat.com> wrote:
>
> Hi,
>
> On 06/14/2013 10:19 AM, Chris Dickens wrote:
> > Hi,
> >
> > All looks good now, thanks!
> >
> > I actually went with the F_GETFL/F_SETFL approach first, then I saw how
> poll_posix.c did it with usbi_pipe() and decided to go that way, for
> consistency.
> >
> > int usbi_pipe(int pipefd[2])
> > {
> > int ret = pipe(pipefd);
> > if (ret != 0) {
> > return ret;
> > }
> > ret = fcntl(pipefd[1], F_SETFD, O_NONBLOCK);
>
> Oh, that looks broken, but if it worked for you (Chris), I guess
> this is allowed too.
>
> Maybe Nathan did things this way because of Mac OS X needing it
> this way (which does not matter for linux_udev.c obviously).
>
> Nathan, what does the fctnl documentation on Mac OS X say on this?
>
>
> Same thing as Linux. It just always worked (and seemed correct) with
> F_SETFD so I never bothered to read the manpage. Probably should just
> change all of them to use F_SETFL (including in darwin_usb.c).
>
> -Nathan
>
>

Attachment: 0001-POSIX-Set-usbi_pipe-to-non-blocking-by-oring-O_NONBL.patch
Description: Binary data

Attachment: 0002-darwin-Use-usbi_pipe-to-create-pipe.patch
Description: Binary data

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to