summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-01-06 06:05:44 -0500
committerColin Walters <walters@verbum.org>2013-01-06 06:05:44 -0500
commitb4e8a2ae8684fab55efe74a7fd4b872c934475fd (patch)
tree5c74b0a7c4f1316bbb886aaa2c8ebe634c1f85a8
parentc98f7e4604d50837074585368b6913b93d3af265 (diff)
downloadlibgsystem-b4e8a2ae8684fab55efe74a7fd4b872c934475fd.tar.gz
fileutils: Add LIBGSYSTEM_ENABLE_GUESTFS_FUSE_WORKAROUND environment variable
This ugly hack is necessary because for some reason guestmount/fuse gives me ENOENT, when it should be returning EXDEV.
-rw-r--r--gsystem-file-utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gsystem-file-utils.c b/gsystem-file-utils.c
index 93a3d68..6d53a6b 100644
--- a/gsystem-file-utils.c
+++ b/gsystem-file-utils.c
@@ -310,10 +310,13 @@ gs_file_linkcopy_sync_data (GFile *src,
{
gboolean ret = FALSE;
int i;
+ gboolean enable_guestfs_fuse_workaround;
gs_unref_object GFile *dest_parent = NULL;
dest_parent = g_file_get_parent (dest);
+ enable_guestfs_fuse_workaround = getenv ("LIBGSYSTEM_ENABLE_GUESTFS_FUSE_WORKAROUND") != NULL;
+
/* 128 attempts seems reasonable... */
for (i = 0; i < 128; i++)
{
@@ -332,7 +335,8 @@ gs_file_linkcopy_sync_data (GFile *src,
{
if (errno == EEXIST)
continue;
- else if (errno == EXDEV || errno == EMLINK || errno == EPERM)
+ else if (errno == EXDEV || errno == EMLINK || errno == EPERM
+ || (enable_guestfs_fuse_workaround && errno == ENOENT))
{
if (!g_file_copy (src, tmp_dest,
G_FILE_COPY_OVERWRITE | G_FILE_COPY_ALL_METADATA | G_FILE_COPY_NOFOLLOW_SYMLINKS,