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_list(), it hangs forever.
I have tracked the issue to the hotplug_poll() function. The call to
udev_monitor_receive_device() blocks forever. Even though this
documentation (
http://www.freedesktop.org/software/systemd/libudev/libudev-udev-monitor.html#udev-monitor-receive-device)
specifies that it is non-blocking by default, I found this not to be the
case. As such, the loop never exits. The call to receive_device blocks
until there is actually udev activity, and it returns a non-NULL value when
this happens. This prevents the loop in hotplug_poll() from ever exiting.
Simply setting the udev_monitor_fd to non-blocking (fcntl with O_NONBLOCK)
resolved this issue for me.
Regards,
Chris Dickens
------------------------------------------------------------------------------
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