Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-16 Thread Hans de Goede
Hi, On 06/14/2013 08:04 PM, Chris Dickens wrote: > Hi, > > Here's two patches to address this, one for usbi_pipe and one for darwin. Thanks for the patches, I've applied (and pushed) the 1st patch, I'll let Nathan deal with the 2nd one. Regards, Hans ---

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-14 Thread Chris Dickens
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 wrote: > > > On

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-14 Thread Nathan Hjelm
On Jun 14, 2013, at 02:58 AM, Hans de Goede 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. >

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-14 Thread Hans de Goede
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 r

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-14 Thread Chris Dickens
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(p

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-14 Thread Hans de Goede
Hi, On 06/13/2013 08:16 PM, Chris Dickens wrote: > Hi, > > Here's the patch. Thanks, I've just pushed a somewhat modified version to master, I made 2 changes: 1) Use F_SETFL rather then F_SETFD as according to the manpage for O_NONBLOCK, F_SETFL should be used. I'm surprised it works with F

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-13 Thread Chris Dickens
Hi, Here's the patch. BTW, I was running RHEL6.4 with libudev 147-2.46. Regards, Chris On Thu, Jun 13, 2013 at 2:23 AM, Hans de Goede wrote: > Hi, > > > On 06/13/2013 12:10 AM, Chris Dickens wrote: > >> Hi, >> >> I'm running the latest code from the master branch (** >> cf8a313b2cdb6a25f0073

Re: [Libusbx-devel] hotplug_poll() on Linux hangs

2013-06-13 Thread Hans de Goede
Hi, On 06/13/2013 12:10 AM, Chris Dickens wrote: > Hi, > > I'm running the latest code from the master branch > (cf8a313b2cdb6a25f00730452aab9130cac5c52b) and am in the process of > converting my application to use hotplug functionality on Linux. When my > application calls libusb_get_device_li