gresolv: Handle POLLERR on DNS UDP socket
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 1 Dec 2010 16:35:58 +0000 (16:35 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 1 Dec 2010 16:35:58 +0000 (16:35 +0000)
commit3c9edd5e215d2939b0f61c7f6cd87d30c6965f6d
tree522b088ffe401b5d2f2c7e3e1deb09593f660923
parent311f0b1124d761ef510510c5f74c8d02b71ea6d3
gresolv: Handle POLLERR on DNS UDP socket

If we get an error on the UDP socket, we'll currently go into an endless
loop eating CPU with poll() returning POLLERR and us ignoring it.

This at least hooks things up so that our callback gets called, and we
stop looping. But the callback's handling of POLLERR isn't correct. It
should close the socket and open a new one. As it is, it's just going to
try to use the same broken socket again for the next request. But at least
with this patch it'll stop eating CPU.
gweb/gresolv.c