summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-07-03 15:10:35 +0000
committerJim Meyering <jim@meyering.net>2006-07-03 15:10:35 +0000
commita47c5ca291f51f1efcf3322b7e0aa0e31e6404e8 (patch)
tree27f05f08197278cfe7d5f957947e45a5dff977c7 /src
parent2741ffb8b4cdf076c5e973931c9afb474f1c5306 (diff)
downloadcoreutils-a47c5ca291f51f1efcf3322b7e0aa0e31e6404e8.tar.xz
The dev/inode of the topmost directory in each hierarchy were not
being recorded. * src/remove.c (remove_cwd_entries): Don't call cycle_check here. (AD_push): Call it from here instead.
Diffstat (limited to 'src')
-rw-r--r--src/remove.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/remove.c b/src/remove.c
index bc0b92b7b..f85372bb1 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -590,6 +590,17 @@ AD_push (int fd_cwd, Dirstack_state *ds, char const *dir,
}
}
+ if (cycle_check (&ds->cycle_check_state, dir_sb_from_parent))
+ {
+ error (0, 0, _("\
+WARNING: Circular directory structure.\n\
+This almost certainly means that you have a corrupted file system.\n\
+NOTIFY YOUR SYSTEM MANAGER.\n\
+The following directory is part of the cycle:\n %s\n"),
+ quote (full_filename (".")));
+ longjmp (ds->current_arg_jumpbuf, 1);
+ }
+
/* Extend the stack. */
obstack_blank (&ds->Active_dir, sizeof (struct AD_ent));
@@ -1160,17 +1171,6 @@ remove_cwd_entries (DIR **dirp,
break;
}
- if (cycle_check (&ds->cycle_check_state, subdir_sb))
- {
- error (0, 0, _("\
-WARNING: Circular directory structure.\n\
-This almost certainly means that you have a corrupted file system.\n\
-NOTIFY YOUR SYSTEM MANAGER.\n\
-The following directory is part of the cycle:\n %s\n"),
- quote (full_filename (".")));
- longjmp (ds->current_arg_jumpbuf, 1);
- }
-
*subdir = xstrdup (f);
if (closedir (*dirp) != 0)
{