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

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