Handle filesystems (like ntfs-3g) that return EEXIST instead of ENOTEMPTY
authorAlexander Larsson <alexl@redhat.com>
Wed, 27 Feb 2008 11:16:58 +0000 (11:16 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Wed, 27 Feb 2008 11:16:58 +0000 (11:16 +0000)
2008-02-26  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (g_local_file_delete):
Handle filesystems (like ntfs-3g) that return EEXIST instead
of ENOTEMPTY (#518816)

svn path=/trunk/; revision=6598

gio/ChangeLog
gio/glocalfile.c

index 3fbe392..4dc738f 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-26  Alexander Larsson  <alexl@redhat.com>
+
+        * glocalfile.c:
+        (g_local_file_delete):
+       Handle filesystems (like ntfs-3g) that return EEXIST instead
+       of ENOTEMPTY (#518816)
+
 2008-02-25  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.15.6 ===
index ec15104..326685e 100644 (file)
@@ -1295,6 +1295,12 @@ g_local_file_delete (GFile         *file,
     {
       int errsv = errno;
 
+      /* Posix allows EEXIST too, but the more sane error
+        is G_IO_ERROR_NOT_FOUND, and its what nautilus
+        expects */
+      if (errsv == EEXIST)
+       errsv = ENOTEMPTY;
+
       g_set_error (error, G_IO_ERROR,
                   g_io_error_from_errno (errsv),
                   _("Error removing file: %s"),