evolution-data-server r9244 - trunk/camel/providers/local



Author: mbarnes
Date: Thu Jul 31 21:09:46 2008
New Revision: 9244
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9244&view=rev

Log:
2008-07-31  Matthew Barnes  <mbarnes redhat com>

	** Fixes bug #540295

	* camel/providers/local/camel-local-store.c (xrename):
	Use g_rename() for all platforms.  Previous POSIX logic didn't
	work for VFAT filesystems.  (Patch by Sergio)



Modified:
   trunk/camel/providers/local/ChangeLog
   trunk/camel/providers/local/camel-local-store.c

Modified: trunk/camel/providers/local/camel-local-store.c
==============================================================================
--- trunk/camel/providers/local/camel-local-store.c	(original)
+++ trunk/camel/providers/local/camel-local-store.c	Thu Jul 31 21:09:46 2008
@@ -335,35 +335,12 @@
 			err = errno;
 			ret = -1;
 		}
-#ifndef G_OS_WIN32
-	} else if (S_ISDIR(st.st_mode)) { /* use rename for dirs */
-		if (rename(old, new) == 0
-		    || stat(new, &st) == 0) {
-			ret = 0;
-		} else {
-			err = errno;
-			ret = -1;
-		}
-	} else if (link(old, new) == 0 /* and link for files */
-		   || (stat(new, &st) == 0 && st.st_nlink == 2)) {
-		if (unlink(old) == 0) {
-			ret = 0;
-		} else {
-			err = errno;
-			unlink(new);
-			ret = -1;
-		}
-	} else {
-		err = errno;
-		ret = -1;
-#else
 	} else if ((!g_file_test (new, G_FILE_TEST_EXISTS) || g_remove (new) == 0) &&
 		   g_rename(old, new) == 0) {
 		ret = 0;
 	} else {
 		err = errno;
 		ret = -1;
-#endif
 	}
 
 	if (ret == -1) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]