]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* src/dd.c (flags): noatime and nofollow now depend on
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 5 Oct 2006 21:39:12 +0000 (21:39 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 5 Oct 2006 21:39:12 +0000 (21:39 +0000)
HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
(usage): Output info about noatime and nofollow only if
they are known to work.
* src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
than O_NOFOLLOW, when testing whether it's possible to avoid a
race condition reliably.

ChangeLog
src/dd.c
src/remove.c

index 1ebe1cdd4a1dedccef944fba4fc9107e3936f8ad..f394bb4ef2dbf0e59eaf681010f76182e3a8301c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * src/dd.c (flags): noatime and nofollow now depend on
+       HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
+       (usage): Output info about noatime and nofollow only if
+       they are known to work.
+       * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
+       than O_NOFOLLOW, when testing whether it's possible to avoid a
+       race condition reliably.
+
 2006-10-05  Jim Meyering  <jim@meyering.net>
 
        * tests/install/basic-1: Skip the latter part of this test if the
index 211c73127627c91be6801f2dc235afeb54a85f1d..4a052c356e248084b0b97d47e2f456693c759bd5 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -265,9 +265,9 @@ static struct symbol_value const flags[] =
   {"direct",   O_DIRECT},
   {"directory",        O_DIRECTORY},
   {"dsync",    O_DSYNC},
-  {"noatime",  O_NOATIME},
+  {"noatime",  HAVE_WORKING_O_NOATIME ? O_NOATIME : 0},
   {"noctty",   O_NOCTTY},
-  {"nofollow", O_NOFOLLOW},
+  {"nofollow", HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0},
   {"nolinks",  O_NOLINKS},
   {"nonblock", O_NONBLOCK},
   {"sync",     O_SYNC},
@@ -470,12 +470,12 @@ 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 (O_NOATIME)
+      if (HAVE_WORKING_O_NOATIME)
        fputs (_("  noatime   do not update access time\n"), stdout);
       if (O_NOCTTY)
        fputs (_("  noctty    do not assign controlling terminal from file\n"),
               stdout);
-      if (O_NOFOLLOW)
+      if (HAVE_WORKING_O_NOFOLLOW)
        fputs (_("  nofollow  do not follow symlinks\n"), stdout);
       if (O_NOLINKS)
        fputs (_("  nolinks   fail if multiply-linked\n"), stdout);
index 13a6e2768cfa86c2a9be152d6a117f20fbf544f6..d362db0eec7c794dd4e59c55fd6df1f2f74a2ec5 100644 (file)
@@ -621,7 +621,7 @@ AD_push (int fd_cwd, Dirstack_state *ds, char const *dir,
 
   /* If our uses of openat are guaranteed not to
      follow a symlink, then we can skip this check.  */
-  if ( ! O_NOFOLLOW)
+  if (! HAVE_WORKING_O_NOFOLLOW)
     {
       struct stat sb;
       if (fstat (fd_cwd, &sb) != 0)