bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm -r --one-file-system won't delete recursively


From: Pádraig Brady
Subject: Re: rm -r --one-file-system won't delete recursively
Date: Fri, 18 Dec 2009 10:02:44 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

On 17/12/09 09:50, Jan Larres wrote:
Hi,

trying to delete a directory structure with -r --one-file-system doesn't
work, since it complains about subdirectories being on a different
device, which isn't true.

Simple example:

$ mkdir -p foo/bar
$ rm -r --one-file-system foo
rm: skipping `foo/bar', since it's on a different device
$ rm -r --one-file-system foo/bar/
$ rm -r --one-file-system foo/

Leaving out --one-file-system works as expected.

This is with coreutils 8.1 on Debian unstable.

Oops. This should fix it and will be in the soon to be released 8.3
I'll add a test and commit today after doing a few more checks.

diff --git a/src/remove.c b/src/remove.c
index 5847200..1306e8f 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -548,7 +548,7 @@ rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x)
         if (ent->fts_info == FTS_DP
             && x->one_file_system
             && FTS_ROOTLEVEL < ent->fts_level
-            && ent->fts_statp->st_ino != fts->fts_dev)
+            && ent->fts_statp->st_dev != fts->fts_dev)
           {
             mark_ancestor_dirs (ent);
             error (0, 0, _("skipping %s, since it's on a different device"),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]