From 4e73fea3e3b6fb721b91bb81e5357fb805eb590d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 22 Feb 2007 19:09:35 +0100 Subject: Honor dd's noatime flag if possible, even if not supported on build fs * doc/coreutils.texi (dd invocation): Warn that noatime might not be reliable. * src/dd.c (flags, usage): Look at O_NOATIME, not HAVE_WORKING_O_NOATIME, to decide whether to support the noatime flag, so that dd attempts O_NOATIME even if the build file system does not support it. Problem reported by Jim Meyering today in bug-coreutils. * tests/dd/misc: Generate a warning, not a failure, if noatime exists but fails. --- src/dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dd.c b/src/dd.c index d699955c5..27a4a08c4 100644 --- a/src/dd.c +++ b/src/dd.c @@ -265,7 +265,7 @@ static struct symbol_value const flags[] = {"direct", O_DIRECT}, {"directory", O_DIRECTORY}, {"dsync", O_DSYNC}, - {"noatime", HAVE_WORKING_O_NOATIME ? O_NOATIME : 0}, + {"noatime", O_NOATIME}, {"noctty", O_NOCTTY}, {"nofollow", HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0}, {"nolinks", O_NOLINKS}, @@ -472,7 +472,7 @@ Each FLAG symbol may be:\n\ fputs (_(" sync likewise, but also for metadata\n"), stdout); if (O_NONBLOCK) fputs (_(" nonblock use non-blocking I/O\n"), stdout); - if (HAVE_WORKING_O_NOATIME) + if (O_NOATIME) fputs (_(" noatime do not update access time\n"), stdout); if (O_NOCTTY) fputs (_(" noctty do not assign controlling terminal from file\n"), -- cgit v1.2.3-70-g09d2