From 90875dcfc93e79d23f5ac4ebf0d212aca96d8fe1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 25 May 2015 09:46:02 -0400 Subject: 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 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.1