]> git.eshelyaron.com Git - emacs.git/commitdiff
Demote errors from utimensat copying directories
authorPo Lu <luangruo@yahoo.com>
Sat, 26 Aug 2023 01:53:32 +0000 (09:53 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 26 Aug 2023 01:57:32 +0000 (09:57 +0800)
* lisp/files.el (copy-directory): Wrap set-file-times within
with-demoted-errors.

* src/fileio.c (Fcopy_file): Adjust commentary.

lisp/files.el
src/fileio.c

index 1803eb9ed9d50b3a7c155891ff07e68a8ed51d43..a015dd3cf4dec8304b7f114c2a01119c9af87e45 100644 (file)
@@ -6622,7 +6622,11 @@ into NEWNAME instead."
                                     (file-attributes directory))))
              (follow-flag (unless follow 'nofollow)))
          (if modes (set-file-modes newname modes follow-flag))
-         (if times (set-file-times newname times follow-flag)))))))
+         (when times
+            ;; Don't didactically fail if file times can't be set, as
+            ;; some file systems forbid modifying them.
+            (with-demoted-errors "Setting file times: %s"
+              (set-file-times newname times follow-flag))))))))
 
 \f
 ;; At time of writing, only info uses this.
index 51e3e8849d150b0f1071f657ebeb8ef07f3100b1..23e1a83d8bf7150d3d27bb4067110e36dfefcea2 100644 (file)
@@ -2518,8 +2518,8 @@ permissions.  */)
       ts[1] = get_stat_mtime (&st);
       if (futimens (ofd, ts) != 0
          /* Various versions of the Android C library are missing
-            futimens, which leads a gnulib fallback to be installed
-            that uses fdutimens instead.  However, fdutimens is not
+            futimens, prompting Gnulib to install a fallback that
+            uses fdutimens instead.  However, fdutimens is not
             supported on many Android kernels, so just silently fail
             if errno is ENOTSUP or ENOSYS.  */
 #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY