pidgin: 849d4f72: In our child DNS lookup processes, don't...

markdoliner at markdoliner at
Wed Sep 10 18:05:47 EDT 2008

Revision: 849d4f7265598a9f0340411c4c0c0401d488ec3b
Ancestor: a2330b7944094a31f5d9b60e6bd02a2ae913497b
Author: markdoliner at
Date: 2008-09-10T21:48:33
Branch: im.pidgin.pidgin

Modified files:


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)

-------------- next part --------------
--- libpurple/dnsquery.c	cc8a513419aadd60d1959e4ca1e2c721945774db
+++ libpurple/dnsquery.c	42121cad1d9a0e892eb148e24da8f1c39f954533
@@ -209,16 +209,6 @@ purple_dnsquery_resolver_run(int child_o
 	 * 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: "

More information about the Commits mailing list