From f0e54fd3280ab55f6226c4baba07047494db5885 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 27 Feb 2008 11:16:58 +0000 Subject: [PATCH] Handle filesystems (like ntfs-3g) that return EEXIST instead of ENOTEMPTY 2008-02-26 Alexander Larsson * 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 | 7 +++++++ gio/glocalfile.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/gio/ChangeLog b/gio/ChangeLog index 3fbe392..4dc738f 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2008-02-26 Alexander Larsson + + * glocalfile.c: + (g_local_file_delete): + Handle filesystems (like ntfs-3g) that return EEXIST instead + of ENOTEMPTY (#518816) + 2008-02-25 Matthias Clasen * === Released 2.15.6 === diff --git a/gio/glocalfile.c b/gio/glocalfile.c index ec15104..326685e 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -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"), -- 2.7.4