emacs-devel
[Top][All Lists]
Advanced

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

Re: master 349798a9b8: Demote errors from utimensat copying directories


From: Eli Zaretskii
Subject: Re: master 349798a9b8: Demote errors from utimensat copying directories
Date: Sat, 26 Aug 2023 12:07:45 +0300

> From: Po Lu <luangruo@yahoo.com>
> Cc: Bruno Haible <bruno@clisp.org>,  emacs-devel@gnu.org,  Paul Eggert
>  <eggert@cs.ucla.edu>
> Date: Sat, 26 Aug 2023 16:22:32 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> diff --git a/lisp/files.el b/lisp/files.el
> >> index 1803eb9..a015dd3 100644
> >> --- a/lisp/files.el
> >> +++ b/lisp/files.el
> >> @@ -6622,7 +6622,11 @@ copy-directory
> >>                                      (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))))))))
> >
> > I think we should only demote these errors on Android, not on other
> > systems.  Setting correct file times when copying/modifying files is
> > an important feature, and users should be alerted when it somehow
> > fails, unless the failure is expected.  And it only is expected on
> > Android, AFAIU.
> 
> Given that, I'll resort to disrearding such errors from set-file-times
> only on the pertinent filesystems instead.

Thanks.

> > Alternatively, the Gnulib folks (CC'd) should modify their fdutimens
> > replacement to return ENOSYS/ENOTSUP on Android filesystems.
> 
> Gnulib is not relevant here, as the ``filesystems'' which fail are
> implemented within androidvfs.c.

Maybe I'm misunderstanding, but the comment in fileio.c seems to imply
that the problem is with Gnulib's replacement for futimens:

      if (futimens (ofd, ts) != 0
          /* Various versions of the Android C library are missing
             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.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]