<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On 3 December 2014 at 14:53, Marek Chalupa <span dir="ltr"><<a href="mailto:mchqwerty@gmail.com" target="_blank">mchqwerty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">+ *   fds[0].fd = wl_display_get_fd(display);<br></div></div><div><div class="h5">
+ *   fds[0].event = POLLIN | POLLHUP | POLLERR;<br>
</div></div></blockquote><div><br></div><div>POLLHUP and POLLERR are not valid for fds[0].events (note spelling); they can be returned in revents if these events happened, but you don't explicitly select for them.</div><div><br></div><div>Other than that, these look good to me, with the caveat that it might be nice to invert the order of prepare_read()'s documentation: currently it talks about the problem the function solves, and only later goes on to explain the pattern you should actually use. It would be nice to just explain what to do, and only later explain why you shouldn't do anything else.</div><div><br></div><div>Thanks for doing this! It's super-helpful, and magically resolves one of the things on my post-it TODO note. ;)</div><div><br></div><div>Cheers,</div><div>Daniel</div></div></div></div>