im.pidgin.pidgin: 4ce909291d6a5f3740e648dcfde56ae73badd206

nwalp at pidgin.im nwalp at pidgin.im
Sat Nov 3 14:10:44 EDT 2007


-----------------------------------------------------------------
Revision: 4ce909291d6a5f3740e648dcfde56ae73badd206
Ancestor: 0e154355bb3e8bdaeb793b142075b60671b37a48
Author: nwalp at pidgin.im
Date: 2007-11-03T17:52:28
Branch: im.pidgin.pidgin

Modified files:
        libpurple/buddyicon.c libpurple/core.c
        libpurple/desktopitem.c libpurple/dnsquery.c libpurple/ft.c
        libpurple/log.c libpurple/nat-pmp.c libpurple/network.c
        libpurple/plugins/tcl/tcl.c
        libpurple/protocols/bonjour/bonjour.c
        libpurple/protocols/bonjour/jabber.c
        libpurple/protocols/irc/dcc_send.c
        libpurple/protocols/jabber/si.c
        libpurple/protocols/msn/notification.c
        libpurple/protocols/msn/servconn.c
        libpurple/protocols/msn/soap.c
        libpurple/protocols/msn/soap2.c
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/oscar/flap_connection.c
        libpurple/protocols/oscar/odc.c
        libpurple/protocols/oscar/oft.c
        libpurple/protocols/oscar/peer.c
        libpurple/protocols/qq/qq_proxy.c
        libpurple/protocols/qq/udp_proxy_s5.c
        libpurple/protocols/sametime/sametime.c
        libpurple/protocols/silc/util.c
        libpurple/protocols/silc10/silc.c
        libpurple/protocols/silc10/util.c
        libpurple/protocols/toc/toc.c
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/ycht.c libpurple/proxy.c
        libpurple/util.c libpurple/win32/libc_interface.c

ChangeLog: 

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)

-------------- next part --------------
============================================================
--- libpurple/buddyicon.c	78316942ada9202600bf1b0112fbba0b20337eef
+++ libpurple/buddyicon.c	84f321cc5c530656d8cd7c7ce38d722a27659341
@@ -116,7 +116,7 @@ purple_buddy_icon_data_cache(PurpleStore
 		{
 			purple_debug_error("buddyicon",
 			                   "Unable to create directory %s: %s\n",
-			                   dirname, strerror(errno));
+			                   dirname, g_strerror(errno));
 		}
 	}
 
@@ -125,7 +125,7 @@ purple_buddy_icon_data_cache(PurpleStore
 		if (!fwrite(purple_imgstore_get_data(img), purple_imgstore_get_size(img), 1, file))
 		{
 			purple_debug_error("buddyicon", "Error writing %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 		}
 		else
 			purple_debug_info("buddyicon", "Wrote cache file: %s\n", path);
@@ -135,7 +135,7 @@ purple_buddy_icon_data_cache(PurpleStore
 	else
 	{
 		purple_debug_error("buddyicon", "Unable to create file %s: %s\n",
-		                   path, strerror(errno));
+		                   path, g_strerror(errno));
 		g_free(path);
 		return;
 	}
@@ -163,7 +163,7 @@ purple_buddy_icon_data_uncache_file(cons
 		if (g_unlink(path))
 		{
 			purple_debug_error("buddyicon", "Failed to delete %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 		}
 		else
 		{
@@ -951,7 +951,7 @@ migrate_buddy_icon(PurpleBlistNode *node
 			if (!fwrite(icon_data, icon_len, 1, file))
 			{
 				purple_debug_error("buddyicon", "Error writing %s: %s\n",
-				                   path, strerror(errno));
+				                   path, g_strerror(errno));
 			}
 			else
 				purple_debug_info("buddyicon", "Wrote migrated cache file: %s\n", path);
@@ -961,7 +961,7 @@ migrate_buddy_icon(PurpleBlistNode *node
 		else
 		{
 			purple_debug_error("buddyicon", "Unable to create file %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 			g_free(new_filename);
 			g_free(path);
 
@@ -1056,7 +1056,7 @@ _purple_buddy_icons_blist_loaded_cb()
 			{
 				purple_debug_error("buddyicon",
 				                   "Unable to create directory %s: %s\n",
-				                   dirname, strerror(errno));
+				                   dirname, g_strerror(errno));
 			}
 		}
 	}
============================================================
--- libpurple/core.c	f4f5b2c6ec48ed3a5f96545d2f3049e5ea0253b2
+++ libpurple/core.c	625de6f1a5d864c10da237ea65a2f9d9eb5826d3
@@ -378,7 +378,7 @@ move_and_symlink_dir(const char *path, c
 	if (g_rename(path, new_name))
 	{
 		purple_debug_error("core", "Error renaming %s to %s: %s. Please report this at http://developer.pidgin.im\n",
-		                   path, new_name, strerror(errno));
+		                   path, new_name, g_strerror(errno));
 		g_free(new_name);
 		return FALSE;
 	}
@@ -391,7 +391,7 @@ move_and_symlink_dir(const char *path, c
 	if (symlink(new_name, old_name))
 	{
 		purple_debug_warning("core", "Error symlinking %s to %s: %s. Please report this at http://developer.pidgin.im\n",
-		                     old_name, new_name, strerror(errno));
+		                     old_name, new_name, g_strerror(errno));
 	}
 	g_free(old_name);
 	g_free(new_name);
@@ -447,7 +447,7 @@ purple_core_migrate(void)
 		if (g_mkdir(user_dir, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
 		{
 			purple_debug_error("core", "Error creating directory %s: %s. Please report this at http://developer.pidgin.im\n",
-			                   user_dir, strerror(errno));
+			                   user_dir, g_strerror(errno));
 			g_free(status_file);
 			g_free(old_user_dir);
 			return FALSE;
@@ -459,7 +459,7 @@ purple_core_migrate(void)
 	if (!(fp = g_fopen(status_file, "w")))
 	{
 		purple_debug_error("core", "Error opening file %s for writing: %s. Please report this at http://developer.pidgin.im\n",
-		                   status_file, strerror(errno));
+		                   status_file, g_strerror(errno));
 		g_free(status_file);
 		g_free(old_user_dir);
 		return FALSE;
@@ -517,7 +517,7 @@ purple_core_migrate(void)
 				{
 					char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL);
 					purple_debug_error("core", "Error reading symlink %s: %s. Please report this at http://developer.pidgin.im\n",
-					                   name_utf8, strerror(errno));
+					                   name_utf8, g_strerror(errno));
 					g_free(name_utf8);
 					g_free(name);
 					g_dir_close(dir);
@@ -555,7 +555,7 @@ purple_core_migrate(void)
 				if (symlink(link, logs_dir))
 				{
 					purple_debug_error("core", "Error symlinking %s to %s: %s. Please report this at http://developer.pidgin.im\n",
-					                   logs_dir, link, strerror(errno));
+					                   logs_dir, link, g_strerror(errno));
 					g_free(link);
 					g_free(name);
 					g_free(logs_dir);
@@ -612,7 +612,7 @@ purple_core_migrate(void)
 					if (g_mkdir(new_icons_dir, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
 					{
 						purple_debug_error("core", "Error creating directory %s: %s. Please report this at http://developer.pidgin.im\n",
-						                   new_icons_dir, strerror(errno));
+						                   new_icons_dir, g_strerror(errno));
 						g_free(new_icons_dir);
 						g_dir_close(icons_dir);
 						g_free(name);
@@ -675,7 +675,7 @@ purple_core_migrate(void)
 			if (!(fp = g_fopen(name, "rb")))
 			{
 				purple_debug_error("core", "Error opening file %s for reading: %s. Please report this at http://developer.pidgin.im\n",
-				                   name, strerror(errno));
+				                   name, g_strerror(errno));
 				g_free(name);
 				g_dir_close(dir);
 				g_free(status_file);
@@ -687,7 +687,7 @@ purple_core_migrate(void)
 			if (!(new_file = g_fopen(new_name, "wb")))
 			{
 				purple_debug_error("core", "Error opening file %s for writing: %s. Please report this at http://developer.pidgin.im\n",
-				                   new_name, strerror(errno));
+				                   new_name, g_strerror(errno));
 				fclose(fp);
 				g_free(new_name);
 				g_free(name);
@@ -706,7 +706,7 @@ purple_core_migrate(void)
 				if (size != sizeof(buf) && !feof(fp))
 				{
 					purple_debug_error("core", "Error reading %s: %s. Please report this at http://developer.pidgin.im\n",
-					                   name, strerror(errno));
+					                   name, g_strerror(errno));
 					fclose(new_file);
 					fclose(fp);
 					g_free(new_name);
@@ -720,7 +720,7 @@ purple_core_migrate(void)
 				if (!fwrite(buf, size, 1, new_file) && ferror(new_file) != 0)
 				{
 					purple_debug_error("core", "Error writing %s: %s. Please report this at http://developer.pidgin.im\n",
-					                   new_name, strerror(errno));
+					                   new_name, g_strerror(errno));
 					fclose(new_file);
 					fclose(fp);
 					g_free(new_name);
@@ -735,12 +735,12 @@ purple_core_migrate(void)
 			if (fclose(new_file))
 			{
 				purple_debug_error("core", "Error writing: %s: %s. Please report this at http://developer.pidgin.im\n",
-				                   new_name, strerror(errno));
+				                   new_name, g_strerror(errno));
 			}
 			if (fclose(fp))
 			{
 				purple_debug_warning("core", "Error closing %s: %s\n",
-				                     name, strerror(errno));
+				                     name, g_strerror(errno));
 			}
 			g_free(new_name);
 		}
@@ -754,7 +754,7 @@ purple_core_migrate(void)
 	if (g_unlink(status_file))
 	{
 		purple_debug_error("core", "Error unlinking file %s: %s. Please report this at http://developer.pidgin.im\n",
-		                   status_file, strerror(errno));
+		                   status_file, g_strerror(errno));
 		g_free(status_file);
 		return FALSE;
 	}
============================================================
--- libpurple/desktopitem.c	f4b8d61844c1fc385be6c0a10098239abe2640e6
+++ libpurple/desktopitem.c	4ffb78baee41eddd99ce46de0f661bda7fe94b77
@@ -1155,7 +1155,7 @@ purple_desktop_item_new_from_file (const
 
 	dfile = g_fopen(filename, "r");
 	if (!dfile) {
-		printf ("Can't open %s: %s", filename, strerror(errno));
+		printf ("Can't open %s: %s", filename, g_strerror(errno));
 		return NULL;
 	}
 	
============================================================
--- libpurple/dnsquery.c	0ddd5e827518101947da5f67acc3b436926f83bc
+++ libpurple/dnsquery.c	e2c239b19422fcaef6ba5ad5d7ee70cf06fe8521
@@ -346,7 +346,7 @@ purple_dnsquery_resolver_new(gboolean sh
 	/* 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 @@ purple_dnsquery_resolver_new(gboolean sh
 	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 @@ send_dns_request_to_child(PurpleDnsQuery
 		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 @@ send_dns_request_to_child(PurpleDnsQuery
 	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 @@ host_resolved(gpointer data, gint source
 		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) {
============================================================
--- libpurple/ft.c	32dae7657417fd89f64ba4b5563ffbff9ae19013
+++ libpurple/ft.c	e4378574d55f93733a556d6d955ca8b56f033992
@@ -207,15 +207,15 @@ static void purple_xfer_show_file_error(
 	switch(xfer_type) {
 		case PURPLE_XFER_SEND:
 			msg = g_strdup_printf(_("Error reading %s: \n%s.\n"),
-								  utf8, strerror(err));
+								  utf8, g_strerror(err));
 			break;
 		case PURPLE_XFER_RECEIVE:
 			msg = g_strdup_printf(_("Error writing %s: \n%s.\n"),
-								  utf8, strerror(err));
+								  utf8, g_strerror(err));
 			break;
 		default:
 			msg = g_strdup_printf(_("Error accessing %s: \n%s.\n"),
-								  utf8, strerror(err));
+								  utf8, g_strerror(err));
 			break;
 	}
 	g_free(utf8);
============================================================
--- libpurple/log.c	8ec69bf3049d9e715183ba0ad7fd521f7d3f849e
+++ libpurple/log.c	2ed5624583e7266fb26f4f82490e1808d5c0ec60
@@ -756,7 +756,7 @@ convert_image_tags(const PurpleLog *log,
 					if (!fwrite(image_data, image_byte_count, 1, image_file))
 					{
 						purple_debug_error("log", "Error writing %s: %s\n",
-						                   path, strerror(errno));
+						                   path, g_strerror(errno));
 						fclose(image_file);
 
 						/* Attempt to not leave half-written files around. */
@@ -771,7 +771,7 @@ convert_image_tags(const PurpleLog *log,
 				else
 				{
 					purple_debug_error("log", "Unable to create file %s: %s\n",
-					                   path, strerror(errno));
+					                   path, g_strerror(errno));
 				}
 			}
 
@@ -1108,7 +1108,7 @@ gboolean purple_log_common_deleter(Purpl
 		return TRUE;
 	else if (ret == -1)
 	{
-		purple_debug_error("log", "Failed to delete: %s - %s\n", data->path, strerror(errno));
+		purple_debug_error("log", "Failed to delete: %s - %s\n", data->path, g_strerror(errno));
 	}
 	else
 	{
@@ -1143,7 +1143,7 @@ gboolean purple_log_common_is_deletable(
 		g_free(dirname);
 		return TRUE;
 	}
-	purple_debug_info("log", "access(%s) failed: %s\n", dirname, strerror(errno));
+	purple_debug_info("log", "access(%s) failed: %s\n", dirname, g_strerror(errno));
 	g_free(dirname);
 #else
 	/* Unless and until someone writes equivalent win32 code,
@@ -1638,7 +1638,7 @@ static GList *old_logger_list(PurpleLogT
 			if (!(index = g_fopen(pathstr, "rb")))
 			{
 				purple_debug_error("log", "Failed to open index file \"%s\" for reading: %s\n",
-				                 pathstr, strerror(errno));
+				                 pathstr, g_strerror(errno));
 
 				/* Fall through so that we'll parse the log file. */
 			}
@@ -1675,7 +1675,7 @@ static GList *old_logger_list(PurpleLogT
 
 	if (!(file = g_fopen(purple_stringref_value(pathref), "rb"))) {
 		purple_debug_error("log", "Failed to open log file \"%s\" for reading: %s\n",
-		                   purple_stringref_value(pathref), strerror(errno));
+		                   purple_stringref_value(pathref), g_strerror(errno));
 		purple_stringref_unref(pathref);
 		g_free(pathstr);
 		return NULL;
@@ -1684,7 +1684,7 @@ static GList *old_logger_list(PurpleLogT
 	index_tmp = g_strdup_printf("%s.XXXXXX", pathstr);
 	if ((index_fd = g_mkstemp(index_tmp)) == -1) {
 		purple_debug_error("log", "Failed to open index temp file: %s\n",
-		                 strerror(errno));
+		                 g_strerror(errno));
 		g_free(pathstr);
 		g_free(index_tmp);
 		index = NULL;
@@ -1692,7 +1692,7 @@ static GList *old_logger_list(PurpleLogT
 		if ((index = fdopen(index_fd, "wb")) == NULL)
 		{
 			purple_debug_error("log", "Failed to fdopen() index temp file: %s\n",
-			                 strerror(errno));
+			                 g_strerror(errno));
 			close(index_fd);
 			if (index_tmp != NULL)
 			{
@@ -1828,7 +1828,7 @@ static GList *old_logger_list(PurpleLogT
 		if (g_rename(index_tmp, pathstr))
 		{
 			purple_debug_warning("log", "Failed to rename index temp file \"%s\" to \"%s\": %s\n",
-			                   index_tmp, pathstr, strerror(errno));
+			                   index_tmp, pathstr, g_strerror(errno));
 			g_unlink(index_tmp);
 			g_free(index_tmp);
 		}
============================================================
--- libpurple/nat-pmp.c	c70b83d3e4647da383dce665296f88014e8ac1ca
+++ libpurple/nat-pmp.c	e64e69ba27a98d5e20a196a4eb0a75846dcc6e50
@@ -312,7 +312,7 @@ purple_pmp_get_public_ip()
 	
 	if (sendto(sendfd, &req, sizeof(req), 0, (struct sockaddr *)(gateway), sizeof(struct sockaddr)) < 0)
 	{
-		purple_debug_info("nat-pmp", "There was an error sending the NAT-PMP public IP request! (%s)\n", strerror(errno));
+		purple_debug_info("nat-pmp", "There was an error sending the NAT-PMP public IP request! (%s)\n", g_strerror(errno));
 		g_free(gateway);
 		pmp_info.status = PURPLE_PMP_STATUS_UNABLE_TO_DISCOVER;
 		return NULL;
@@ -320,7 +320,7 @@ purple_pmp_get_public_ip()
 
 	if (setsockopt(sendfd, SOL_SOCKET, SO_RCVTIMEO, &req_timeout, sizeof(req_timeout)) < 0)
 	{
-		purple_debug_info("nat-pmp", "There was an error setting the socket's options! (%s)\n", strerror(errno));
+		purple_debug_info("nat-pmp", "There was an error setting the socket's options! (%s)\n", g_strerror(errno));
 		g_free(gateway);
 		pmp_info.status = PURPLE_PMP_STATUS_UNABLE_TO_DISCOVER;
 		return NULL;
@@ -332,7 +332,7 @@ purple_pmp_get_public_ip()
 	{
 		if (errno != EAGAIN)
 		{
-			purple_debug_info("nat-pmp", "There was an error receiving the response from the NAT-PMP device! (%s)\n", strerror(errno));
+			purple_debug_info("nat-pmp", "There was an error receiving the response from the NAT-PMP device! (%s)\n", g_strerror(errno));
 			g_free(gateway);
 			pmp_info.status = PURPLE_PMP_STATUS_UNABLE_TO_DISCOVER;
 			return NULL;
@@ -432,13 +432,13 @@ purple_pmp_create_map(PurplePmpType type
 	/* TODO: Non-blocking! */
 	success = (sendto(sendfd, &req, sizeof(req), 0, (struct sockaddr *)(gateway), sizeof(struct sockaddr)) >= 0);
 	if (!success)
-		purple_debug_info("nat-pmp", "There was an error sending the NAT-PMP mapping request! (%s)\n", strerror(errno));
+		purple_debug_info("nat-pmp", "There was an error sending the NAT-PMP mapping request! (%s)\n", g_strerror(errno));
 
 	if (success)
 	{
 		success = (setsockopt(sendfd, SOL_SOCKET, SO_RCVTIMEO, &req_timeout, sizeof(req_timeout)) >= 0);
 		if (!success)
-			purple_debug_info("nat-pmp", "There was an error setting the socket's options! (%s)\n", strerror(errno));
+			purple_debug_info("nat-pmp", "There was an error setting the socket's options! (%s)\n", g_strerror(errno));
 	}
 
 	if (success)
@@ -448,7 +448,7 @@ purple_pmp_create_map(PurplePmpType type
 		success = ((recvfrom(sendfd, resp, sizeof(PurplePmpMapResponse), 0, NULL, NULL) >= 0) ||
 				   (errno == EAGAIN));
 		if (!success)
-			purple_debug_info("nat-pmp", "There was an error receiving the response from the NAT-PMP device! (%s)\n", strerror(errno));
+			purple_debug_info("nat-pmp", "There was an error receiving the response from the NAT-PMP device! (%s)\n", g_strerror(errno));
 	}
 
 	if (success)
============================================================
--- libpurple/network.c	b4244caf2c0eb63fedac087389113c7f48d7aec6
+++ libpurple/network.c	1aacfba7a244514983803a537e98303b78208699
@@ -285,7 +285,7 @@ purple_network_do_listen(unsigned short 
 #ifndef _WIN32
 		purple_debug_warning("network", "getaddrinfo: %s\n", gai_strerror(errnum));
 		if (errnum == EAI_SYSTEM)
-			purple_debug_warning("network", "getaddrinfo: system error: %s\n", strerror(errno));
+			purple_debug_warning("network", "getaddrinfo: system error: %s\n", g_strerror(errno));
 #else
 		purple_debug_warning("network", "getaddrinfo: Error Code = %d\n", errnum);
 #endif
@@ -302,7 +302,7 @@ purple_network_do_listen(unsigned short 
 		if (listenfd < 0)
 			continue;
 		if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0)
-			purple_debug_warning("network", "setsockopt: %s\n", strerror(errno));
+			purple_debug_warning("network", "setsockopt: %s\n", g_strerror(errno));
 		if (bind(listenfd, next->ai_addr, next->ai_addrlen) == 0)
 			break; /* success */
 		/* XXX - It is unclear to me (datallah) whether we need to be
@@ -318,26 +318,26 @@ purple_network_do_listen(unsigned short 
 	struct sockaddr_in sockin;
 
 	if ((listenfd = socket(AF_INET, socket_type, 0)) < 0) {
-		purple_debug_warning("network", "socket: %s\n", strerror(errno));
+		purple_debug_warning("network", "socket: %s\n", g_strerror(errno));
 		return NULL;
 	}
 
 	if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0)
-		purple_debug_warning("network", "setsockopt: %s\n", strerror(errno));
+		purple_debug_warning("network", "setsockopt: %s\n", g_strerror(errno));
 
 	memset(&sockin, 0, sizeof(struct sockaddr_in));
 	sockin.sin_family = PF_INET;
 	sockin.sin_port = htons(port);
 
 	if (bind(listenfd, (struct sockaddr *)&sockin, sizeof(struct sockaddr_in)) != 0) {
-		purple_debug_warning("network", "bind: %s\n", strerror(errno));
+		purple_debug_warning("network", "bind: %s\n", g_strerror(errno));
 		close(listenfd);
 		return NULL;
 	}
 #endif
 
 	if (socket_type == SOCK_STREAM && listen(listenfd, 4) != 0) {
-		purple_debug_warning("network", "listen: %s\n", strerror(errno));
+		purple_debug_warning("network", "listen: %s\n", g_strerror(errno));
 		close(listenfd);
 		return NULL;
 	}
@@ -426,7 +426,7 @@ purple_network_get_port_from_fd(int fd)
 
 	len = sizeof(addr);
 	if (getsockname(fd, (struct sockaddr *) &addr, &len) == -1) {
-		purple_debug_warning("network", "getsockname: %s\n", strerror(errno));
+		purple_debug_warning("network", "getsockname: %s\n", g_strerror(errno));
 		return 0;
 	}
 
============================================================
--- libpurple/plugins/tcl/tcl.c	85fd2f11198ec4707c428060da2a9711832871f9
+++ libpurple/plugins/tcl/tcl.c	551fea5b44c4d71bef25090712efa9db3040c324
@@ -198,7 +198,7 @@ static gboolean tcl_probe_plugin(PurpleP
 	}
 
 	if (ferror(fp)) {
-		purple_debug(PURPLE_DEBUG_ERROR, "tcl", "error reading %s (%s)\n", plugin->path, strerror(errno));
+		purple_debug(PURPLE_DEBUG_ERROR, "tcl", "error reading %s (%s)\n", plugin->path, g_strerror(errno));
 		g_free(buf);
 		fclose(fp);
 		return FALSE;
============================================================
--- libpurple/protocols/bonjour/bonjour.c	064472bb81a426955460af9c5b943f16b5badc4c
+++ libpurple/protocols/bonjour/bonjour.c	fe3c401853bd89a558413e3720f2fbd5f341f8a2
@@ -648,7 +648,7 @@ initialize_default_account_values()
 	/* TODO: Avoid 'localhost,' if possible */
 	if (gethostname(hostname, 255) != 0) {
 		purple_debug_warning("bonjour", "Error when getting host name: %s.  Using \"localhost.\"\n",
-				strerror(errno));
+				g_strerror(errno));
 		strcpy(hostname, "localhost");
 	}
 	default_hostname = g_strdup(hostname);
============================================================
--- libpurple/protocols/bonjour/jabber.c	c8f885925e2466642b3e097d4ea2468b291f0086
+++ libpurple/protocols/bonjour/jabber.c	2e05251fe50fc6291baa61d39cfabc8bdd078194
@@ -244,7 +244,7 @@ _send_data_write_cb(gpointer data, gint 
 		return;
 	else if (ret <= 0) {
 		PurpleConversation *conv;
-		const char *error = strerror(errno);
+		const char *error = g_strerror(errno);
 
 		purple_debug_error("bonjour", "Error sending message to buddy %s error: %s\n",
 				   purple_buddy_get_name(pb), error ? error : "(null)");
@@ -287,7 +287,7 @@ _send_data(PurpleBuddy *pb, char *messag
 		ret = 0;
 	else if (ret <= 0) {
 		PurpleConversation *conv;
-		const char *error = strerror(errno);
+		const char *error = g_strerror(errno);
 
 		purple_debug_error("bonjour", "Error sending message to buddy %s error: %s\n",
 				   purple_buddy_get_name(pb), error ? error : "(null)");
@@ -337,7 +337,7 @@ _client_socket_handler(gpointer data, gi
 		if (errno != EAGAIN) {
 			BonjourBuddy *bb = pb->proto_data;
 
-			purple_debug_warning("bonjour", "receive error: %s\n", strerror(errno));
+			purple_debug_warning("bonjour", "receive error: %s\n", g_strerror(errno));
 
 			bonjour_jabber_close_conversation(bb->conversation);
 			bb->conversation = NULL;
@@ -427,7 +427,7 @@ _start_stream(gpointer data, gint source
 	if (ret == -1 && errno == EAGAIN)
 		return;
 	else if (ret <= 0) {
-		const char *err = strerror(errno);
+		const char *err = g_strerror(errno);
 		PurpleConversation *conv;
 
 		purple_debug_error("bonjour", "Error starting stream with buddy %s at %s:%d error: %s\n",
@@ -482,7 +482,7 @@ static gboolean bonjour_jabber_stream_in
 	if (ret == -1 && errno == EAGAIN)
 		ret = 0;
 	else if (ret <= 0) {
-		const char *err = strerror(errno);
+		const char *err = g_strerror(errno);
 
 		purple_debug_error("bonjour", "Error starting stream with buddy %s at %s:%d error: %s\n",
 				   purple_buddy_get_name(pb), bb->ip ? bb->ip : "(null)", bb->port_p2pj, err ? err : "(null)");
@@ -583,7 +583,7 @@ bonjour_jabber_start(BonjourJabber *data
 	/* Open a listening socket for incoming conversations */
 	if ((data->socket = socket(PF_INET, SOCK_STREAM, 0)) < 0)
 	{
-		purple_debug_error("bonjour", "Cannot open socket: %s\n", strerror(errno));
+		purple_debug_error("bonjour", "Cannot open socket: %s\n", g_strerror(errno));
 		purple_connection_error(data->account->gc, _("Cannot open socket"));
 		return -1;
 	}
@@ -591,7 +591,7 @@ bonjour_jabber_start(BonjourJabber *data
 	/* Make the socket reusable */
 	if (setsockopt(data->socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) != 0)
 	{
-		purple_debug_error("bonjour", "Error setting socket options: %s\n", strerror(errno));
+		purple_debug_error("bonjour", "Error setting socket options: %s\n", g_strerror(errno));
 		purple_connection_error(data->account->gc, _("Error setting socket options"));
 		return -1;
 	}
@@ -615,7 +615,7 @@ bonjour_jabber_start(BonjourJabber *data
 	/* On no!  We tried 10 ports and could not bind to ANY of them */
 	if (!bind_successful)
 	{
-		purple_debug_error("bonjour", "Cannot bind socket: %s\n", strerror(errno));
+		purple_debug_error("bonjour", "Cannot bind socket: %s\n", g_strerror(errno));
 		purple_connection_error(data->account->gc, _("Could not bind socket to port"));
 		return -1;
 	}
@@ -623,7 +623,7 @@ bonjour_jabber_start(BonjourJabber *data
 	/* Attempt to listen on the bound socket */
 	if (listen(data->socket, 10) != 0)
 	{
-		purple_debug_error("bonjour", "Cannot listen on socket: %s\n", strerror(errno));
+		purple_debug_error("bonjour", "Cannot listen on socket: %s\n", g_strerror(errno));
 		purple_connection_error(data->account->gc, _("Could not listen on socket"));
 		return -1;
 	}
@@ -670,7 +670,7 @@ _connected_to_buddy(gpointer data, gint 
 	}
 
 	if (!bonjour_jabber_stream_init(pb, source)) {
-		const char *err = strerror(errno);
+		const char *err = g_strerror(errno);
 		PurpleConversation *conv;
 
 		purple_debug_error("bonjour", "Error starting stream with buddy %s at %s:%d error: %s\n",
============================================================
--- libpurple/protocols/irc/dcc_send.c	1348d8e2d8f864926753faf42528fa087dacffb6
+++ libpurple/protocols/irc/dcc_send.c	580e2831117feab9a4dcd353003ef999ff1d586d
@@ -251,7 +251,7 @@ static void irc_dccsend_send_connected(g
 		 * to the nonblocking nature of the listening socket, so we'll
 		 * just try again next time */
 		/* Let's print an error message anyway */
-		purple_debug_warning("irc", "accept: %s\n", strerror(errno));
+		purple_debug_warning("irc", "accept: %s\n", g_strerror(errno));
 		return;
 	}
 
============================================================
--- libpurple/protocols/jabber/si.c	7cd8d30110ddcd020effadf1031ab7bdcd13f927
+++ libpurple/protocols/jabber/si.c	4c49386697601c4ce0f0262cda588d8740efed00
@@ -536,7 +536,7 @@ jabber_si_xfer_bytestreams_send_connecte
 	if(acceptfd == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
 		return;
 	else if(acceptfd == -1) {
-		purple_debug_warning("jabber", "accept: %s\n", strerror(errno));
+		purple_debug_warning("jabber", "accept: %s\n", g_strerror(errno));
 		return;
 	}
 
============================================================
--- libpurple/protocols/msn/notification.c	d7610358fafdd55d172a7b1d83b43979b21c130d
+++ libpurple/protocols/msn/notification.c	2f51f178c35839935bf4179788d4a19c655d1fbe
@@ -1411,7 +1411,7 @@ url_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	{
 		purple_debug_error("msn",
 						 "Error opening temp passport file: %s\n",
-						 strerror(errno));
+						 g_strerror(errno));
 	}
 	else
 	{
@@ -1460,7 +1460,7 @@ url_cmd(MsnCmdProc *cmdproc, MsnCommand 
 		{
 			purple_debug_error("msn",
 							 "Error closing temp passport file: %s\n",
-							 strerror(errno));
+							 g_strerror(errno));
 
 			g_unlink(session->passport_info.file);
 			g_free(session->passport_info.file);
============================================================
--- libpurple/protocols/msn/servconn.c	71ff602a8a0d95e0f0f24e6414e4bc5279964ef9
+++ libpurple/protocols/msn/servconn.c	a404db10b492bc719f40a4f19f2af1690efa7e8b
@@ -402,7 +402,7 @@ read_cb(gpointer data, gint source, Purp
 	
 			default: purple_debug_error("msn", "servconn read error,"
 						"len: %d, errno: %d, error: %s\n",
-						len, errno, strerror(errno));
+						len, errno, g_strerror(errno));
 				 msn_servconn_got_error(servconn, 
 						 MSN_SERVCONN_ERROR_READ);
 				 return;
============================================================
--- libpurple/protocols/msn/soap.c	fe222827199671c5b50aeec09b4eb38ddf758017
+++ libpurple/protocols/msn/soap.c	30bd3c84691f3a1aabb84747d61096838a60d1c3
@@ -274,7 +274,7 @@ msn_soap_read(MsnSoapConn *soapconn)
 
 			default : purple_debug_error("MSN SOAP", "Read error!"
 						"read len: %d, error = %s\n",
-						len, strerror(errno));
+						len, g_strerror(errno));
 				  purple_input_remove(soapconn->input_handler);
 				  //soapconn->input_handler = 0;
 				  g_free(soapconn->read_buf);
============================================================
--- libpurple/protocols/msn/soap2.c	ee19e56fdff8f846c5c703081e70334aec76e4db
+++ libpurple/protocols/msn/soap2.c	7a2fb66df89d9b21a4d8e42b70eee02bae63fbac
@@ -271,7 +271,7 @@ msn_soap_read_cb(gpointer data, gint fd,
 	if (count < 0 && errno == EAGAIN)
 		return;
 	else if (count <= 0) {
-		purple_debug_info("soap", "read: %s\n", strerror(errno));
+		purple_debug_info("soap", "read: %s\n", g_strerror(errno));
 		purple_ssl_close(conn->ssl);
 		conn->ssl = NULL;
 		msn_soap_connection_handle_next(conn);
============================================================
--- libpurple/protocols/myspace/myspace.c	124dc2c45e7a0d5f4ec68d0208ace0b77b669f13
+++ libpurple/protocols/myspace/myspace.c	8cce50d7d735dffc9951d42e61e2d1905a803293
@@ -2353,7 +2353,7 @@ msim_input_cb(gpointer gc_uncasted, gint
 	} else if (n < 0) {
 		purple_debug_error("msim", "msim_input_cb: read error, ret=%d, "
 			"error=%s, source=%d, fd=%d (%X))\n", 
-			n, strerror(errno), source, session->fd, session->fd);
+			n, g_strerror(errno), source, session->fd, session->fd);
 		purple_connection_error(gc, _("Read error"));
 		return;
 	} else if (n == 0) {
============================================================
--- libpurple/protocols/oscar/flap_connection.c	86b8316839888328970775ee8a4eb3fe5c4eeb82
+++ libpurple/protocols/oscar/flap_connection.c	7f0dd79bf538b8e24bac058ef2707a0bf0d08bb3
@@ -468,7 +468,7 @@ flap_connection_destroy(FlapConnection *
  * @param error_message A brief error message that gives more detail
  *        regarding the reason for the disconnecting.  This should
  *        be NULL for everything except OSCAR_DISCONNECT_LOST_CONNECTION,
- *        in which case it should contain the value of strerror(errno),
+ *        in which case it should contain the value of g_strerror(errno),
  *        and OSCAR_DISCONNECT_COULD_NOT_CONNECT, in which case it
  *        should contain the error_message passed back from the call
  *        to purple_proxy_connect().
@@ -812,7 +812,7 @@ flap_connection_recv_cb(gpointer data, g
 
 				/* Error! */
 				flap_connection_schedule_destroy(conn,
-						OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+						OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 				break;
 			}
 
@@ -873,7 +873,7 @@ flap_connection_recv_cb(gpointer data, g
 
 				/* Error! */
 				flap_connection_schedule_destroy(conn,
-						OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+						OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 				break;
 			}
 
@@ -924,7 +924,7 @@ send_cb(gpointer data, gint source, Purp
 		close(conn->fd);
 		conn->fd = -1;
 		flap_connection_schedule_destroy(conn,
-				OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+				OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 		return;
 	}
 
============================================================
--- libpurple/protocols/oscar/odc.c	0934367189b3e8bca4a66530e9ccc1656c18dd25
+++ libpurple/protocols/oscar/odc.c	aa42e3ea45bae590ba7ad6fa6a70e8208c87a05d
@@ -456,7 +456,7 @@ peer_odc_recv_cb(gpointer data, gint sou
 			return;
 
 		peer_connection_destroy(conn,
-				OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+				OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 		return;
 	}
 
============================================================
--- libpurple/protocols/oscar/oft.c	841b3bc493b1ea71613162c3a6311678d1c2465c
+++ libpurple/protocols/oscar/oft.c	a20226fd6c41891a246036cf927e0aabf8b699d6
@@ -212,7 +212,7 @@ peer_oft_checksum_file(PeerConnection *c
 	if (checksum_data->file == NULL)
 	{
 		purple_debug_error("oscar", "Unable to open %s for checksumming: %s\n",
-				purple_xfer_get_local_filename(xfer), strerror(errno));
+				purple_xfer_get_local_filename(xfer), g_strerror(errno));
 		callback(checksum_data);
 		g_free(checksum_data);
 	}
============================================================
--- libpurple/protocols/oscar/peer.c	dc62688befb4ff27094c83d1a4bdb2ed6ab48777
+++ libpurple/protocols/oscar/peer.c	5dd67cbb8b447e750f6c5917cc584418fe53744a
@@ -317,7 +317,7 @@ peer_connection_recv_cb(gpointer data, g
 				return;
 
 			peer_connection_destroy(conn,
-					OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+					OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 			return;
 		}
 
@@ -367,7 +367,7 @@ peer_connection_recv_cb(gpointer data, g
 			return;
 
 		peer_connection_destroy(conn,
-				OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno));
+				OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno));
 		return;
 	}
 
============================================================
--- libpurple/protocols/qq/qq_proxy.c	a5217211e05d16b748cc9c6245817683f2dc67b3
+++ libpurple/protocols/qq/qq_proxy.c	8c253a09b440aeec5246c5851b8f2f0beadfc4aa
@@ -237,7 +237,7 @@ static void no_one_calls(gpointer data, 
 		close(source);
 		purple_input_remove(phb->inpa);
 
-		purple_debug_error("proxy", "getsockopt SO_ERROR check: %s\n", strerror(error));
+		purple_debug_error("proxy", "getsockopt SO_ERROR check: %s\n", g_strerror(error));
 
 		phb->func(phb->data, -1, _("Unable to connect"));
 		return;
@@ -265,7 +265,7 @@ static gint _qq_proxy_none(struct PHB *p
 
 	if (fd < 0) {
 		purple_debug(PURPLE_DEBUG_ERROR, "QQ Redirect", 
-			"Unable to create socket: %s\n", strerror(errno));
+			"Unable to create socket: %s\n", g_strerror(errno));
 		return -1;
 	}
 
@@ -297,7 +297,7 @@ static gint _qq_proxy_none(struct PHB *p
 			purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Connect in asynchronous mode.\n");
 			phb->inpa = purple_input_add(fd, PURPLE_INPUT_WRITE, no_one_calls, phb);
 		} else {
-			purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection failed: %d\n", strerror(errno));
+			purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection failed: %d\n", g_strerror(errno));
 			close(fd);
 			return -1;
 		}		/* if errno */
@@ -497,7 +497,7 @@ gint qq_proxy_write(qq_data *qd, guint8 
 		ret = send(qd->fd, data, len, 0);
 	}
 	if (ret == -1)
-		purple_connection_error(qd->gc, strerror(errno));
+		purple_connection_error(qd->gc, g_strerror(errno));
 
 	return ret;
 }
============================================================
--- libpurple/protocols/qq/udp_proxy_s5.c	657927ba06ed576a4382bfaea0d6d121ef865fc5
+++ libpurple/protocols/qq/udp_proxy_s5.c	21e99fa2ca80fbcdecd8e37d983ff4ecfb47e4fe
@@ -74,7 +74,7 @@ static void _qq_s5_canread_again(gpointe
 	memcpy(&sin.sin_port, buf + 8, 2);
 
 	if (connect(phb->udpsock, (struct sockaddr *) &sin, sizeof(struct sockaddr_in)) < 0) {
-		purple_debug(PURPLE_DEBUG_INFO, "s5_canread_again", "connect failed: %s\n", strerror(errno));
+		purple_debug(PURPLE_DEBUG_INFO, "s5_canread_again", "connect failed: %s\n", g_strerror(errno));
 		close(phb->udpsock);
 		close(source);
 		g_free(phb->host);
@@ -120,7 +120,7 @@ static void _qq_s5_sendconnect(gpointer 
 
 	ctllen = sizeof(ctlsin);
 	if (getsockname(source, (struct sockaddr *) &ctlsin, &ctllen) < 0) {
-		purple_debug(PURPLE_DEBUG_INFO, "QQ", "getsockname: %s\n", strerror(errno));
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "getsockname: %s\n", g_strerror(errno));
 		close(source);
 		g_free(phb->host);
 		g_free(phb);
@@ -300,7 +300,7 @@ static void _qq_s5_canwrite(gpointer dat
 
 	len = sizeof(error);
 	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
-		purple_debug(PURPLE_DEBUG_INFO, "getsockopt", "%s\n", strerror(errno));
+		purple_debug(PURPLE_DEBUG_INFO, "getsockopt", "%s\n", g_strerror(errno));
 		close(source);
 		if (phb->account == NULL || purple_account_get_connection(phb->account) != NULL) {
 
@@ -329,7 +329,7 @@ static void _qq_s5_canwrite(gpointer dat
 	}
 
 	if (write(source, buf, i) < i) {
-		purple_debug(PURPLE_DEBUG_INFO, "write", "%s\n", strerror(errno));
+		purple_debug(PURPLE_DEBUG_INFO, "write", "%s\n", g_strerror(errno));
 		purple_debug(PURPLE_DEBUG_ERROR, "socks5 proxy", "Unable to write\n");
 		close(source);
 
============================================================
--- libpurple/protocols/sametime/sametime.c	b83a1ce60bf0300289c824fb48ac8b605fe13b83
+++ libpurple/protocols/sametime/sametime.c	499c059ee0c75f5a7ac74ae1554efc3496c47d6e
@@ -1702,7 +1702,7 @@ static void read_cb(gpointer data, gint 
     purple_connection_error(pd->gc, _("Connection reset"));
 
   } else if(ret < 0) {
-    char *msg = strerror(err);
+    char *msg = g_strerror(err);
 
     DEBUG_INFO("error in read callback: %s\n", msg);
 
@@ -2167,7 +2167,7 @@ static void ft_send(struct mwFileTransfe
   } else {
     int err = errno;
     DEBUG_WARN("problem reading from file %s: %s\n",
-	       NSTR(mwFileTransfer_getFileName(ft)), strerror(err));
+	       NSTR(mwFileTransfer_getFileName(ft)), g_strerror(err));
 
     mwFileTransfer_cancel(ft);
   }
@@ -5009,7 +5009,7 @@ static void ft_outgoing_init(PurpleXfer 
   fp = g_fopen(filename, "rb");
   if(! fp) {
     char *msg = g_strdup_printf(_("Error reading file %s: \n%s\n"),
-				filename, strerror(errno));
+				filename, g_strerror(errno));
     purple_xfer_error(purple_xfer_get_type(xfer), acct, xfer->who, msg);
     g_free(msg);
     return;
============================================================
--- libpurple/protocols/silc/util.c	dd1c3ee1af03d94f6a285aed1a767a97acc5aee8
+++ libpurple/protocols/silc/util.c	ba05c36d8d30b327051c8be3e3109938439e4112
@@ -79,7 +79,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 
 	pw = getpwuid(getuid());
 	if (!pw) {
-		purple_debug_error("silc", "silc: %s\n", strerror(errno));
+		purple_debug_error("silc", "silc: %s\n", g_strerror(errno));
 		return FALSE;
 	}
 
@@ -108,7 +108,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 				return FALSE;
 			}
 		} else {
-			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, strerror(errno));
+			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, g_strerror(errno));
 			return FALSE;
 		}
 	} else {
@@ -140,7 +140,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 servfilename, strerror(errno));
+							 servfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -163,7 +163,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 clientfilename, strerror(errno));
+							 clientfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -186,7 +186,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 friendsfilename, strerror(errno));
+							 friendsfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -218,12 +218,12 @@ gboolean silcpurple_check_silc_dir(Purpl
 
 			if ((g_stat(file_public_key, &st)) == -1) {
 				purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n",
-						   file_public_key, strerror(errno));
+						   file_public_key, g_strerror(errno));
 				return FALSE;
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n",
-					   file_public_key, strerror(errno));
+					   file_public_key, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -239,7 +239,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 	if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) {
 		if ((fstat(fd, &st)) == -1) {
 			purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-					   file_private_key, strerror(errno));
+					   file_private_key, g_strerror(errno));
 			close(fd);
 			return FALSE;
 		}
@@ -261,7 +261,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) {
 				if ((fstat(fd, &st)) == -1) {
 					purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-							   file_private_key, strerror(errno));
+							   file_private_key, g_strerror(errno));
 					close(fd);
 					return FALSE;
 				}
@@ -270,12 +270,12 @@ gboolean silcpurple_check_silc_dir(Purpl
 			 * will set the permissions */
 			else if ((g_stat(file_private_key, &st)) == -1) {
 				purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-						   file_private_key, strerror(errno));
+						   file_private_key, g_strerror(errno));
 				return FALSE;
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-					   file_private_key, strerror(errno));
+					   file_private_key, g_strerror(errno));
 			return FALSE;
 		}
 	}
============================================================
--- libpurple/protocols/silc10/silc.c	ac7c8c8d35ee4482dd920753a6e62e85929454bd
+++ libpurple/protocols/silc10/silc.c	e2cbd4d2eb8570facfd77d712f3e14202859fa55
@@ -331,7 +331,7 @@ silcpurple_login(PurpleAccount *account)
 							(char *)purple_account_get_string(account, "private-key", prd),
 				(gc->password == NULL) ? "" : gc->password, &client->pkcs,
 				&client->public_key, &client->private_key)) {
-		g_snprintf(pkd, sizeof(pkd), _("Could not load SILC key pair: %s"), strerror(errno));
+		g_snprintf(pkd, sizeof(pkd), _("Could not load SILC key pair: %s"), g_strerror(errno));
 		purple_connection_error(gc, pkd);
 		return;
 	}
============================================================
--- libpurple/protocols/silc10/util.c	74579a6652cdf5a99ad861f8d977a3fcfa91bf15
+++ libpurple/protocols/silc10/util.c	b192c16035af25ce487e5a800e39d509f0b4aa70
@@ -79,7 +79,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 
 	pw = getpwuid(getuid());
 	if (!pw) {
-		purple_debug_error("silc", "silc: %s\n", strerror(errno));
+		purple_debug_error("silc", "silc: %s\n", g_strerror(errno));
 		return FALSE;
 	}
 
@@ -108,7 +108,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 				return FALSE;
 			}
 		} else {
-			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, strerror(errno));
+			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, g_strerror(errno));
 			return FALSE;
 		}
 	} else {
@@ -140,7 +140,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 servfilename, strerror(errno));
+							 servfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -163,7 +163,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 clientfilename, strerror(errno));
+							 clientfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -186,7 +186,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n",
-							 friendsfilename, strerror(errno));
+							 friendsfilename, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -216,12 +216,12 @@ gboolean silcpurple_check_silc_dir(Purpl
 
 			if ((g_stat(file_public_key, &st)) == -1) {
 				purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n",
-					file_public_key, strerror(errno));
+					file_public_key, g_strerror(errno));
 				return FALSE;
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n",
-							 file_public_key, strerror(errno));
+							 file_public_key, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -237,7 +237,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 	if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) {
 		if ((fstat(fd, &st)) == -1) {
 			purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-							 file_private_key, strerror(errno));
+							 file_private_key, g_strerror(errno));
 			close(fd);
 			return FALSE;
 		}
@@ -257,7 +257,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 			if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) {
 				if ((fstat(fd, &st)) == -1) {
 					purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-							 file_private_key, strerror(errno));
+							 file_private_key, g_strerror(errno));
 					close(fd);
 					return FALSE;
 				}
@@ -266,12 +266,12 @@ gboolean silcpurple_check_silc_dir(Purpl
 			 * will set the permissions */
 			else if ((g_stat(file_private_key, &st)) == -1) {
 				purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-					file_private_key, strerror(errno));
+					file_private_key, g_strerror(errno));
 				return FALSE;
 			}
 		} else {
 			purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-							 file_private_key, strerror(errno));
+							 file_private_key, g_strerror(errno));
 			return FALSE;
 		}
 	}
============================================================
--- libpurple/protocols/toc/toc.c	82d4264c6fbef6b5f6f20011df18e1203c493972
+++ libpurple/protocols/toc/toc.c	5578a9b909c434bd19db59996d7858513adfaba8
@@ -1795,7 +1795,7 @@ static void toc_send_file_callback(gpoin
 			ft->file = g_fopen(ft->filename, "w");
 			if (!ft->file) {
 				buf = g_strdup_printf(_("Could not open %s for writing!"), ft->filename);
-				purple_notify_error(ft->gc, NULL, buf, strerror(errno));
+				purple_notify_error(ft->gc, NULL, buf, g_strerror(errno));
 				g_free(buf);
 				purple_input_remove(ft->inpa);
 				close(source);
@@ -1812,7 +1812,7 @@ static void toc_send_file_callback(gpoin
 			if (!ft->file) {
 				buf = g_strdup_printf("Could not open %s/%s for writing!", ft->filename,
 						ft->hdr.name);
-				purple_notify_error(ft->gc, NULL, buf, strerror(errno));
+				purple_notify_error(ft->gc, NULL, buf, g_strerror(errno));
 				g_free(buf);
 				purple_input_remove(ft->inpa);
 				close(source);
============================================================
--- libpurple/protocols/yahoo/yahoo.c	50745ccd92b706f63d1a0cc3adc8446c193f2f5c
+++ libpurple/protocols/yahoo/yahoo.c	01f7939b8d9c6428ea314c03454aae95dea1fbd9
@@ -2463,7 +2463,7 @@ static void yahoo_pending(gpointer data,
 			return;
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
-				strerror(errno));
+				g_strerror(errno));
 		purple_connection_error(gc, tmp);
 		g_free(tmp);
 		return;
@@ -2630,7 +2630,7 @@ static void yahoo_web_pending(gpointer d
 			return;
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
-				strerror(errno));
+				g_strerror(errno));
 		purple_connection_error(gc, tmp);
 		g_free(tmp);
 		return;
@@ -2701,7 +2701,7 @@ static void yahoo_got_cookies_send_cb(gp
 			purple_input_remove(gc->inpa);
 		gc->inpa = 0;
 		tmp = g_strdup_printf(_("Lost connection with %s:\n%s"),
-				"login.yahoo.com:80", strerror(errno));
+				"login.yahoo.com:80", g_strerror(errno));
 		purple_connection_error(gc, tmp);
 		g_free(tmp);
 		return;
============================================================
--- libpurple/protocols/yahoo/ycht.c	de683275f59ac072cd9e4c999dd975275187d4ec
+++ libpurple/protocols/yahoo/ycht.c	1b79713e7225eeecd90424857529d770392f7263
@@ -473,7 +473,7 @@ static void ycht_pending(gpointer data, 
 			return;
 
 		tmp = g_strdup_printf(_("Lost connection with server\n%s"),
-				strerror(errno));
+				g_strerror(errno));
 		ycht_connection_error(ycht, tmp);
 		g_free(tmp);
 		return;
============================================================
--- libpurple/proxy.c	1f2e006fabf91d32539f9094af01d60dce14c24b
+++ libpurple/proxy.c	6b297275886e775dc5f55f37d82a918af8ff8f55
@@ -429,9 +429,9 @@ socket_ready_cb(gpointer data, gint sour
 		if (ret != 0)
 			error = errno;
 		purple_debug_info("proxy", "Error connecting to %s:%d (%s).\n",
-						connect_data->host, connect_data->port, strerror(error));
+						connect_data->host, connect_data->port, g_strerror(error));
 
-		purple_proxy_connect_data_disconnect(connect_data, strerror(error));
+		purple_proxy_connect_data_disconnect(connect_data, g_strerror(error));
 		return;
 	}
 
@@ -458,7 +458,7 @@ proxy_connect_none(PurpleProxyConnectDat
 	if (connect_data->fd < 0)
 	{
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Unable to create socket:\n%s"), strerror(errno));
+				_("Unable to create socket:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -478,7 +478,7 @@ proxy_connect_none(PurpleProxyConnectDat
 		}
 		else
 		{
-			purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+			purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 		}
 	}
 	else
@@ -496,7 +496,7 @@ proxy_connect_none(PurpleProxyConnectDat
 		{
 			if (ret != 0)
 				error = errno;
-			purple_proxy_connect_data_disconnect(connect_data, strerror(error));
+			purple_proxy_connect_data_disconnect(connect_data, g_strerror(error));
 			return;
 		}
 
@@ -534,7 +534,7 @@ proxy_do_write(gpointer data, gint sourc
 			return;
 
 		/* Error! */
-		purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+		purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 		return;
 	}
 	if (ret < request_len) {
@@ -593,7 +593,7 @@ http_canread(gpointer data, gint source,
 
 		/* Error! */
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Lost connection with server:\n%s"), strerror(errno));
+				_("Lost connection with server:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -832,7 +832,7 @@ http_canwrite(gpointer data, gint source
 	{
 		if (ret != 0)
 			error = errno;
-		purple_proxy_connect_data_disconnect(connect_data, strerror(error));
+		purple_proxy_connect_data_disconnect(connect_data, g_strerror(error));
 		return;
 	}
 
@@ -899,7 +899,7 @@ proxy_connect_http(PurpleProxyConnectDat
 	if (connect_data->fd < 0)
 	{
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Unable to create socket:\n%s"), strerror(errno));
+				_("Unable to create socket:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -937,7 +937,7 @@ proxy_connect_http(PurpleProxyConnectDat
 		}
 		else
 		{
-			purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+			purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 		}
 	}
 	else
@@ -978,7 +978,7 @@ s4_canread(gpointer data, gint source, P
 		}
 	}
 
-	purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+	purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 }
 
 static void
@@ -1003,7 +1003,7 @@ s4_canwrite(gpointer data, gint source, 
 	{
 		if (ret != 0)
 			error = errno;
-		purple_proxy_connect_data_disconnect(connect_data, strerror(error));
+		purple_proxy_connect_data_disconnect(connect_data, g_strerror(error));
 		return;
 	}
 
@@ -1058,7 +1058,7 @@ proxy_connect_socks4(PurpleProxyConnectD
 	if (connect_data->fd < 0)
 	{
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Unable to create socket:\n%s"), strerror(errno));
+				_("Unable to create socket:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1078,7 +1078,7 @@ proxy_connect_socks4(PurpleProxyConnectD
 		}
 		else
 		{
-			purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+			purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 		}
 	}
 	else
@@ -1138,7 +1138,7 @@ s5_canread_again(gpointer data, gint sou
 
 		/* Error! */
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Lost connection with server:\n%s"), strerror(errno));
+				_("Lost connection with server:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1247,7 +1247,7 @@ s5_readauth(gpointer data, gint source, 
 
 		/* Error! */
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Lost connection with server:\n%s"), strerror(errno));
+				_("Lost connection with server:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1347,7 +1347,7 @@ s5_readchap(gpointer data, gint source, 
 
 		/* Error! */
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Lost connection with server:\n%s"), strerror(errno));
+				_("Lost connection with server:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1475,7 +1475,7 @@ s5_canread(gpointer data, gint source, P
 
 		/* Error! */
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Lost connection with server:\n%s"), strerror(errno));
+				_("Lost connection with server:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1584,7 +1584,7 @@ s5_canwrite(gpointer data, gint source, 
 	{
 		if (ret != 0)
 			error = errno;
-		purple_proxy_connect_data_disconnect(connect_data, strerror(error));
+		purple_proxy_connect_data_disconnect(connect_data, g_strerror(error));
 		return;
 	}
 
@@ -1629,7 +1629,7 @@ proxy_connect_socks5(PurpleProxyConnectD
 	if (connect_data->fd < 0)
 	{
 		purple_proxy_connect_data_disconnect_formatted(connect_data,
-				_("Unable to create socket:\n%s"), strerror(errno));
+				_("Unable to create socket:\n%s"), g_strerror(errno));
 		return;
 	}
 
@@ -1649,7 +1649,7 @@ proxy_connect_socks5(PurpleProxyConnectD
 		}
 		else
 		{
-			purple_proxy_connect_data_disconnect(connect_data, strerror(errno));
+			purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
 		}
 	}
 	else
============================================================
--- libpurple/util.c	6309ea6124b8abe1c690c1fe4ad04893d3bd8c33
+++ libpurple/util.c	383cfed34f7becdc1014101f5ecf413ba53378f8
@@ -2505,7 +2505,7 @@ int purple_build_dir (const char *path, 
 		}
 
 		if (g_mkdir(dir, mode) < 0) {
-			purple_debug_warning("build_dir", "mkdir: %s\n", strerror(errno));
+			purple_debug_warning("build_dir", "mkdir: %s\n", g_strerror(errno));
 			g_strfreev(components);
 			g_free(dir);
 			return -1;
@@ -2541,7 +2541,7 @@ purple_util_write_data_to_file(const cha
 		if (g_mkdir(user_dir, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
 		{
 			purple_debug_error("util", "Error creating directory %s: %s\n",
-							 user_dir, strerror(errno));
+							 user_dir, g_strerror(errno));
 			return FALSE;
 		}
 	}
@@ -2576,7 +2576,7 @@ purple_util_write_data_to_file_absolute(
 		{
 			purple_debug_error("util", "Error removing old file "
 					   "%s: %s\n",
-					   filename_temp, strerror(errno));
+					   filename_temp, g_strerror(errno));
 		}
 	}
 
@@ -2586,7 +2586,7 @@ purple_util_write_data_to_file_absolute(
 	{
 		purple_debug_error("util", "Error opening file %s for "
 				   "writing: %s\n",
-				   filename_temp, strerror(errno));
+				   filename_temp, g_strerror(errno));
 		g_free(filename_temp);
 		return FALSE;
 	}
@@ -2599,7 +2599,7 @@ purple_util_write_data_to_file_absolute(
 	if (fclose(file) != 0)
 	{
 		purple_debug_error("util", "Error closing file %s: %s\n",
-				   filename_temp, strerror(errno));
+				   filename_temp, g_strerror(errno));
 		g_free(filename_temp);
 		return FALSE;
 	}
@@ -2631,7 +2631,7 @@ purple_util_write_data_to_file_absolute(
 	if (chmod(filename_temp, S_IRUSR | S_IWUSR) == -1)
 	{
 		purple_debug_error("util", "Error setting permissions of file %s: %s\n",
-						 filename_temp, strerror(errno));
+						 filename_temp, g_strerror(errno));
 	}
 #endif
 
@@ -2640,7 +2640,7 @@ purple_util_write_data_to_file_absolute(
 	{
 		purple_debug_error("util", "Error renaming %s to %s: %s\n",
 				   filename_temp, filename_full,
-				   strerror(errno));
+				   g_strerror(errno));
 	}
 
 	g_free(filename_temp);
@@ -3688,7 +3688,7 @@ url_fetch_recv_cb(gpointer url_data, gin
 					if(new_data == NULL) {
 						purple_debug_error("util",
 								"Failed to allocate %u bytes: %s\n",
-								content_len, strerror(errno));
+								content_len, g_strerror(errno));
 						purple_util_fetch_url_error(gfud,
 								_("Unable to allocate enough memory to hold "
 								  "the contents from %s.  The web server may "
@@ -3726,7 +3726,7 @@ url_fetch_recv_cb(gpointer url_data, gin
 			return;
 		} else {
 			purple_util_fetch_url_error(gfud, _("Error reading from %s: %s"),
-					gfud->website.address, strerror(errno));
+					gfud->website.address, g_strerror(errno));
 			return;
 		}
 	}
@@ -3757,7 +3757,7 @@ url_fetch_send_cb(gpointer data, gint so
 		return;
 	else if (len < 0) {
 		purple_util_fetch_url_error(gfud, _("Error writing to %s: %s"),
-				gfud->website.address, strerror(errno));
+				gfud->website.address, g_strerror(errno));
 		return;
 	}
 	gfud->request_written += len;
============================================================
--- libpurple/win32/libc_interface.c	88838e5ca5bad005e691b713d22936eddc924a10
+++ libpurple/win32/libc_interface.c	0494a7737522a4aa922c0f2cf0b9b21f96763857
@@ -300,7 +300,7 @@ char* wpurple_strerror( int errornum ) {
 		return errbuf;
 	}
 	else
-		return strerror( errornum );
+		return g_strerror( errornum );
 }
 
 /* unistd.h */


More information about the Commits mailing list