+2018-10-08 Bernhard Voelker <mail@bernhard-voelker.de>
+
+ fts: remove FTS_NOATIME
+ This reverts commit da4d6974013c822af1498941e32db774b2031765.
+ We cannot guarantee that O_NOATIME works: e.g. openat fails
+ with EPERM if the effective user ID of the caller does not match
+ the owner of the file and the caller is not privileged.
+ Downstream findutils has never picked up FTS_NOATIME. Discussed at
+ <https://lists.gnu.org/r/bug-gnulib/2018-09/msg00122.html>.
+ * lib/fts_.h (FTS_NOATIME): Remove bit flag.
+ (FTS_OPTIONMASK): Adjust.
+ * lib/fts.c (diropen, fts_open, fts_build): Likewise.
+ (fd_ring_check): Likewise.
+
2018-10-08 Bruno Haible <bruno@clisp.org>
csharpcomp*, csharpexec*: Remove support for pnet.
diropen (FTS const *sp, char const *dir)
{
int open_flags = (O_SEARCH | O_CLOEXEC | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
- | (ISSET (FTS_PHYSICAL) ? O_NOFOLLOW : 0)
- | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
+ | (ISSET (FTS_PHYSICAL) ? O_NOFOLLOW : 0));
int fd = (ISSET (FTS_CWDFD)
? openat (sp->fts_cwd_fd, dir, open_flags)
early, doing it here saves us the trouble of ensuring
later (where it'd be messier) that "." can in fact
be opened. If not, revert to FTS_NOCHDIR mode. */
- int fd = open (".",
- O_SEARCH | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
+ int fd = open (".", O_SEARCH);
if (fd < 0)
{
/* Even if "." is unreadable, don't revert to FTS_NOCHDIR mode
(((ISSET(FTS_PHYSICAL) \
&& ! (ISSET(FTS_COMFOLLOW) \
&& cur->fts_level == FTS_ROOTLEVEL)) \
- ? O_NOFOLLOW : 0) \
- | (ISSET (FTS_NOATIME) ? O_NOATIME : 0)), \
+ ? O_NOFOLLOW : 0)), \
Pdir_fd)
/*
int fd = i_ring_pop (&fd_w);
if (0 <= fd)
{
- int open_flags = O_SEARCH | O_CLOEXEC | O_NOATIME;
+ int open_flags = O_SEARCH | O_CLOEXEC;
int parent_fd = openat (cwd_fd, "..", open_flags);
if (parent_fd < 0)
{
dirent.d_type data. */
# define FTS_DEFER_STAT 0x0400
-# define FTS_NOATIME 0x0800 /* use O_NOATIME during traversal */
+/* 0x0800 unused, was non-working FTS_NOATIME */
/* Use this flag to disable stripping of trailing slashes
from input path names during fts_open initialization. */