[libgsystem] shutil: Fall back to a copy if link() returns EPERM too



commit 90875dcfc93e79d23f5ac4ebf0d212aca96d8fe1
Author: Colin Walters <walters verbum org>
Date:   Mon May 25 09:46:02 2015 -0400

    shutil: Fall back to a copy if link() returns EPERM too
    
    There are a few reasons we could get EPERM such as
    /proc/sys/fs/protected_hardlinks being enabled.
    
    This was showing up using rpm-ostree with Bodhi; we haven't fully
    debugged it, but suspect this patch will fix it.

 src/gsystem-shutil.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gsystem-shutil.c b/src/gsystem-shutil.c
index e8e6ca3..27564dc 100644
--- a/src/gsystem-shutil.c
+++ b/src/gsystem-shutil.c
@@ -182,7 +182,7 @@ cp_internal (GFile         *src,
             {
               if (link (gs_file_get_path_cached (src_child), gs_file_get_path_cached (dest_child)) == -1)
                 {
-                  if (!(errno == EMLINK || errno == EXDEV))
+                  if (!(errno == EMLINK || errno == EXDEV || errno == EPERM))
                     {
                       gs_set_error_from_errno (error, errno);
                       goto out;


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