diff libpurple/dnsquery.c @ 21121:35b4f1dc4c8d

replace most calls to strerror with calls to g_strerror. strerror will return a locale-specific string in the locale-specific encoding, which isn't guaranteed to be UTF-8. g_strerror will always return a UTF-8 string. I left gg and zephyr untouched, since gg doesn't include glib headers yet, and zephyr does something weird with a #define for strerror. Someone more familliar with those should take a look. And the win32 guys should check and see if I screwed something up, since they had strerror #defined to something else. This should fix #2247 (and maybe some mystery crashes)
author Nathan Walp <nwalp@pidgin.im>
date Sat, 03 Nov 2007 17:52:28 +0000
parents 6a128c9bd170
children ae58ffd5e929
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Sat Nov 03 17:04:25 2007 +0000
+++ b/libpurple/dnsquery.c	Sat Nov 03 17:52:28 2007 +0000
@@ -346,7 +346,7 @@
 	/* Create pipes for communicating with the child process */
 	if (pipe(child_out) || pipe(child_in)) {
 		purple_debug_error("dns",
-				   "Could not create pipes: %s\n", strerror(errno));
+				   "Could not create pipes: %s\n", g_strerror(errno));
 		return NULL;
 	}
 
@@ -374,7 +374,7 @@
 	if (resolver->dns_pid == -1) {
 		purple_debug_error("dns",
 				   "Could not create child process for DNS: %s\n",
-				   strerror(errno));
+				   g_strerror(errno));
 		purple_dnsquery_resolver_destroy(resolver);
 		return NULL;
 	}
@@ -416,7 +416,7 @@
 		return FALSE;
 	} else if (pid < 0) {
 		purple_debug_warning("dns", "Wait for DNS child %d failed: %s\n",
-				resolver->dns_pid, strerror(errno));
+				resolver->dns_pid, g_strerror(errno));
 		purple_dnsquery_resolver_destroy(resolver);
 		return FALSE;
 	}
@@ -430,7 +430,7 @@
 	rc = write(resolver->fd_in, &dns_params, sizeof(dns_params));
 	if (rc < 0) {
 		purple_debug_error("dns", "Unable to write to DNS child %d: %d\n",
-				resolver->dns_pid, strerror(errno));
+				resolver->dns_pid, g_strerror(errno));
 		purple_dnsquery_resolver_destroy(resolver);
 		return FALSE;
 	}
@@ -571,7 +571,7 @@
 		purple_dnsquery_resolved(query_data, hosts);
 
 	} else if (rc == -1) {
-		g_snprintf(message, sizeof(message), _("Error reading from resolver process:\n%s"), strerror(errno));
+		g_snprintf(message, sizeof(message), _("Error reading from resolver process:\n%s"), g_strerror(errno));
 		purple_dnsquery_failed(query_data, message);
 
 	} else if (rc == 0) {