# HG changeset patch # User Mark Doliner # Date 1221083313 0 # Node ID 005649461c774cbb49915b7f8fa0bc1f8ed4a1bd # Parent f085e284f2df0228fa8531f45fc974d737eedcbb In our child DNS lookup processes, don't bother to use select to watch the pipe with our parent. These processes don't do anything else, and they only need to watch one fd, so we can just use a blocking read() call. I don't think this will negatively affect anything, and it seems to fix some kind of funky rare race condition where the libpurple client will block while trying to read() a response from the child. If you think we should continue using select here, or you notice some problems with this, please let me know (and maybe even revert this) diff -r f085e284f2df -r 005649461c77 libpurple/dnsquery.c --- a/libpurple/dnsquery.c Wed Sep 10 21:32:50 2008 +0000 +++ b/libpurple/dnsquery.c Wed Sep 10 21:48:33 2008 +0000 @@ -209,16 +209,6 @@ * the result back to our parent, when finished. */ while (1) { - fd_set fds; - struct timeval tv = { .tv_sec = 40 , .tv_usec = 0 }; - FD_ZERO(&fds); - FD_SET(child_in, &fds); - rc = select(child_in + 1, &fds, NULL, NULL, &tv); - if (!rc) { - if (show_debug) - printf("dns[%d]: nobody needs me... =(\n", getpid()); - break; - } rc = read(child_in, &dns_params, sizeof(dns_params_t)); if (rc < 0) { fprintf(stderr, "dns[%d]: Error: Could not read dns_params: "