pidgin: 1ca17dd2: In our forked DNS resolver processes, do...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Aug 24 13:55:57 EDT 2011


----------------------------------------------------------------------
Revision: 1ca17dd26ee879f7580c72b03d018e444e0a5144
Parent:   b57e497539c02b410846cabcf29c9bf27b5c96ab
Author:   markdoliner at pidgin.im
Date:     08/24/11 13:54:39
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1ca17dd26ee879f7580c72b03d018e444e0a5144

Changelog: 

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.

Changes against parent b57e497539c02b410846cabcf29c9bf27b5c96ab

  patched  libpurple/dnsquery.c

-------------- next part --------------
============================================================
--- libpurple/dnsquery.c	ec35993e4ab83e1f41e806c33efeb197196248d8
+++ libpurple/dnsquery.c	457b4ffe462fc9280c1e994dc77b5d9aaa1f80f1
@@ -297,6 +297,10 @@ purple_dnsquery_resolver_run(int child_o
 		}
 		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;


More information about the Commits mailing list