[gvfs] fuse: Add GError to errno mappings for G_IO_ERROR_WOULD_RECURSE and G_IO_ERROR_WOULD_MERGE



commit 4341cf2b36e408c3598bc533d9510ff6ff5b0f84
Author: Rok Mandeljc <rok mandeljc gmail com>
Date:   Sat Aug 9 22:26:28 2014 +0200

    fuse: Add GError to errno mappings for G_IO_ERROR_WOULD_RECURSE and G_IO_ERROR_WOULD_MERGE
    
    This patch adds the following GError to errno mappings to
    errno_from_error():
    G_IO_ERROR_WOULD_RECURSE -> EXDEV
    G_IO_ERROR_WOULD_MERGE -> ENOTEMPTY
    
    The first mapping is required to allow 'mv' to rename/move a
    directory in a gvfs-fuse directory that belongs to a backend
    without support for a native move operation. In such cases,
    g_file_move() returns G_IO_ERROR_WOULD_RECURSE, which needs to
    be mapped to -EXDEV in order for mv to fall back to recursive
    copy & delete operation.
    
    Similarly, G_IO_ERROR_WOULD_MERGE is returned when trying to
    move/merge two non-empty directories. By mapping it to -ENOTEMPTY,
    the error message returned by 'mv' becomes ": Directory not empty"
    instead of generic ": Input/output error".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734568
    
    Signed-off-by: Rok Mandeljc <rok mandeljc gmail com>

 client/gvfsfusedaemon.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 82e7c30..12bcebb 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -163,6 +163,8 @@ errno_from_error (GError *error)
       { G_IO_ERROR_TIMED_OUT,          EIO          },
       { G_IO_ERROR_BUSY,               EBUSY        },
       { G_IO_ERROR_WOULD_BLOCK,        EAGAIN       },
+      { G_IO_ERROR_WOULD_RECURSE,      EXDEV        },
+      { G_IO_ERROR_WOULD_MERGE,        ENOTEMPTY    },
       { -1,                            -1           }
     };
 


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