From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 349798a9b8: Demote errors from utimensat copying directories Date: Sat, 26 Aug 2023 12:07:45 +0300 Message-ID: <83sf86kw7y.fsf@gnu.org> References: <835y52meww.fsf@gnu.org> <87wmxi1ad3.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bruno@clisp.org, emacs-devel@gnu.org, eggert@cs.ucla.edu To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 26 11:07:35 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZpGZ-0009vK-28 for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Aug 2023 11:07:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZpGI-0005lZ-H4; Sat, 26 Aug 2023 05:07:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZpGH-0005hm-MS for emacs-devel@gnu.org; Sat, 26 Aug 2023 05:07:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZpGH-0006m3-5w; Sat, 26 Aug 2023 05:07:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IbVlg9bS6//phWSNMuZwa6dVLD3pNBD96yn/V7qLNDk=; b=NgDUe8iH4v/i xXbAKwEAHD8NQtIvJpyfyBxsGOTKto92uGebH5x0l4HDOX8M/+AO9kG63bpg9EI+WFxnEGKnKoWAZ 2n2ngOz/ps+ix/zYYk7F+hQE1sMT0VS40tle41nB4S//2IJQvDOry5yeEsqu5lMeVeinChiUgnA/3 UkJwYueKhDu8QSNfjQvWCynsjupfEBx/JWZPuQQivF1Aej2qf3eJygWmcXp+x8KQI5vpPOzNlCzrx I4BhFHnbPy4kG7crzlntc/0W8hlcak3w8MYcenEzpWLHZwlifza9CoNrL4fo8qH5ze0UueSdGRtx8 VtH5SpZ2k9Sj/VuW51cEcQ==; In-Reply-To: <87wmxi1ad3.fsf@yahoo.com> (message from Po Lu on Sat, 26 Aug 2023 16:22:32 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309242 Archived-At: > From: Po Lu > Cc: Bruno Haible , emacs-devel@gnu.org, Paul Eggert > > Date: Sat, 26 Aug 2023 16:22:32 +0800 > > Eli Zaretskii 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. */