pidgin: 86f0d791: I was wondering why the more sane error ...

datallah at pidgin.im datallah at pidgin.im
Mon Mar 17 16:35:42 EDT 2008


-----------------------------------------------------------------
Revision: 86f0d791b2c9e5b64c8cf03fd53a9e1e5d3a018a
Ancestor: c6a27eedf0994d2bb7c42760857c0ffe469e0c6b
Author: datallah at pidgin.im
Date: 2008-03-17T20:32:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/86f0d791b2c9e5b64c8cf03fd53a9e1e5d3a018a

Modified files:
        libpurple/win32/libc_interface.c

ChangeLog: 

I was wondering why the more sane error messges were never appearing... now I know.  There is also a fix here that uses glib's internal rename stuff on recent versions because it is more robust than our win32 version.

-------------- next part --------------
============================================================
--- libpurple/win32/libc_interface.c	7b490aa1339e9ffafcc9793123b3d8b31e6b8ffc
+++ libpurple/win32/libc_interface.c	51846b5d42c593f050cf7c2b9622e01383c48f54
@@ -320,12 +320,16 @@ char* wpurple_strerror(int errornum) {
 		switch(errornum) {
 			case WSAECONNABORTED: /* 10053 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection interrupted by other software on your computer."));
+				break;
 			case WSAECONNRESET: /* 10054 */
 				snprintf(errbuf, sizeof(errbuf), _("Remote host closed connection."));
+				break;
 			case WSAETIMEDOUT: /* 10060 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection timed out."));
+				break;
 			case WSAECONNREFUSED: /*10061 */
 				snprintf(errbuf, sizeof(errbuf), _("Connection refused."));
+				break;
 			default:
 				snprintf(errbuf, sizeof(errbuf), "Windows socket error #%d", errornum);
 		}
@@ -452,6 +456,11 @@ int wpurple_rename (const char *oldname,
 int wpurple_rename (const char *oldname, const char *newname) {
 	struct stat oldstat, newstat;
 
+	/* As of Glib 2.8.5, g_rename() uses MoveFileEx() with MOVEFILE_REPLACE_EXISTING to behave more sanely */
+	if (glib_check_version(2, 8, 5) == NULL) {
+		return g_rename(oldname, newname);
+	}
+
 	if(g_stat(oldname, &oldstat) == 0) {
 		/* newname exists */
 		if(g_stat(newname, &newstat) == 0) {


More information about the Commits mailing list