Since v171, the socket used by udev-monitor is non-blocking. From the code, I'm assuming it is considered an error to call the function if no data is avaiable. It would help if the documentation was clearer about this.
Created attachment 63173 [details] [review] Patch to fix doc for udev_monitor_receive_device()
Created attachment 63174 [details] [review] Cleaner patch Always proof-read patches before submitting
+ * It is an error to call this function if there is no data available. + * The function will return #NULL in this case. You should monitor the + * file handle returned by udev_monitor_get_fd() to ensure data is available + * before calling. Note that the behaviour of this function changed in + * libudev 171. Code that assumes this function will block should be changed + * to use poll(). Hmm, it's not really an *error*, sure, also not very useful, but it just returns EAGAIN and NULL. Also users are free to change the flags of the file descriptor to blocking mode. I added a sentence to explain that. Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.