Fix #506: ignore chmod errors for filesystems not supporting the operation
authorAlberto Griggio <>
Tue, 29 Aug 2017 09:13:17 +0000 (10:13 +0100)
committerColin Clark <colin.clark@cclark.uk>
Tue, 29 Aug 2017 09:13:17 +0000 (10:13 +0100)
https://github.com/BestImageViewer/geeqie/issues/506

src/ui_fileops.c

index c4466fc..f2faa56 100644 (file)
@@ -483,7 +483,12 @@ gboolean copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint m
                        /* Ignores chown errors, while still doing chown
                           (so root still can copy files preserving ownership) */
                        ret = TRUE;
-                       if (chmod(tl, st.st_mode) < 0) ret = FALSE;
+                       if (chmod(tl, st.st_mode) < 0) {
+                            struct stat st2;
+                            if (stat(tl, &st2) != 0 || st2.st_mode != st.st_mode) {
+                                ret = FALSE;
+                            }
+                        }
                        }
 
                tb.actime = st.st_atime;