summaryrefslogtreecommitdiff
path: root/lib/cycle-check.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-04 05:59:05 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-04 05:59:05 +0000
commited664fa4ea5bdee8952dbcdf614b87303b8f67a1 (patch)
tree8eb24500336a929d707656b1f61bb1d493c8c25d /lib/cycle-check.h
parent3029cabe16d9d55bea2327bed94e071c61d2cfe0 (diff)
downloadgnulib-ed664fa4ea5bdee8952dbcdf614b87303b8f67a1.tar.gz
* cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
macro is used before the first cycle_check call.
Diffstat (limited to 'lib/cycle-check.h')
-rw-r--r--lib/cycle-check.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/cycle-check.h b/lib/cycle-check.h
index b137a60a85..927f3e51f6 100644
--- a/lib/cycle-check.h
+++ b/lib/cycle-check.h
@@ -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; \