# HG changeset patch # User Mark Doliner # Date 1314208479 0 # Node ID d3d41ba0c3b8a5787181c74818428b86fdfa6525 # Parent fbbb9edb1d4c40c2af2c6fe775d34939980d7d24 In our forked DNS resolver processes, don't bail out if we get a retryable error while reading from our parent socket. I think EAGAIN and EWOULDBLOCK never happen because this is a non-blocking socket AND because we're using select (seems like we'd be fine using one or the other, and it's not necessary to use both?). I believe this is correct behavior and we should be doing this same thing everywhere we read from sockets. I think we probably don't check for EINTR in many places where we should. diff -r fbbb9edb1d4c -r d3d41ba0c3b8 libpurple/dnsquery.c --- a/libpurple/dnsquery.c Wed Aug 24 15:06:36 2011 +0000 +++ b/libpurple/dnsquery.c Wed Aug 24 17:54:39 2011 +0000 @@ -297,6 +297,10 @@ } rc = read(child_in, &dns_params, sizeof(dns_params_t)); if (rc < 0) { + if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { + /* Try again */ + continue; + } fprintf(stderr, "dns[%d]: Error: Could not read dns_params: " "%s\n", getpid(), strerror(errno)); break;