1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-13 13:45:55 +02:00

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.
This commit is contained in:
Jim Meyering
2006-07-03 15:10:35 +00:00
parent 2741ffb8b4
commit a47c5ca291
2 changed files with 16 additions and 11 deletions
+5
View File
@@ -1,5 +1,10 @@
2006-07-03 Jim Meyering <jim@meyering.net>
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.
Fix two small leaks.
* src/remove.c (AD_stack_clear): New function.
(rm_1): Use it.
+11 -11
View File
@@ -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)
{