From: Po Lu Date: Sat, 26 Aug 2023 01:53:32 +0000 (+0800) Subject: Demote errors from utimensat copying directories X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~4458 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=349798a9b81fb4f7f8e1e1963ea9039a4a68a471;p=emacs.git Demote errors from utimensat copying directories * lisp/files.el (copy-directory): Wrap set-file-times within with-demoted-errors. * src/fileio.c (Fcopy_file): Adjust commentary. --- diff --git a/lisp/files.el b/lisp/files.el index 1803eb9ed9d..a015dd3cf4d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)))))))) ;; At time of writing, only info uses this. diff --git a/src/fileio.c b/src/fileio.c index 51e3e8849d1..23e1a83d8bf 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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