]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
authorJim Meyering <jim@meyering.net>
Mon, 3 Jul 2006 15:20:23 +0000 (15:20 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 3 Jul 2006 15:20:23 +0000 (15:20 +0000)
macro is used before the first cycle_check call.

lib/ChangeLog
lib/cycle-check.h

index 1ce4084af51ef35d2ec0f3e7026dba0853ac1a68..ab12de5f3e8ea36436a40cfe1c48cb5b03534c2a 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-03  Jim Meyering  <jim@meyering.net>
+
+       * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
+       macro is used before the first cycle_check call.
+
 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
 
        * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
index b137a60a85a63ada4f98d665cba77826ac2f4130..927f3e51f659cacca8f1a768dd2baffd3d67e4ca 100644 (file)
@@ -45,6 +45,9 @@ bool cycle_check (struct cycle_check_state *state, struct stat const *sb);
 # define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir)        \
   do                                                           \
     {                                                          \
+      /* You must call cycle_check at least once before using this macro.  */ \
+      if ((State)->chdir_counter == 0)                         \
+        abort ();                                              \
       if (SAME_INODE ((State)->dev_ino, SB_subdir))            \
        {                                                       \
          (State)->dev_ino.st_dev = (SB_dir).st_dev;            \