"find -follow -type l" doesn't quite work.

Mike Frysinger vapier at gentoo.org
Tue Oct 6 03:16:48 UTC 2009


On Tuesday 29 September 2009 20:41:41 Denys Vlasenko wrote:
> On Tuesday 29 September 2009 23:18, Rob Landley wrote:
> > On Tuesday 29 September 2009 04:01:12 Denys Vlasenko wrote:
> > > On Fri, Sep 25, 2009 at 11:35 AM, Rob Landley <rob at landley.net> wrote:
> > > > An easy way to find all dead symlinks under /path is:
> > > >
> > > >  find -follow -type l /path
> > > >
> > > > Using gnu find, that will produce a list of symlinks that, when
> > > > you've followed them as far as they can, are still symlinks.  Using
> > > > busybox, it finds the same set of files, but instead of listing them
> > > > to stdout it gives error messages about them.  This behavior is less
> > > > useful.
> > >
> > > Please try attached patch.
> > >
> > > --
> > > vda
> >
> > It's full of unrelated changes that conflict with the last release
> > version:
> >
> > Applying
> > /home/landley/firmware/firmware/sources/patches/busybox-findl.patch
> > patching file findutils/find.c
> 
> Can you try to apply just this to 1.15.1?
> 
> http://busybox.net/downloads/fixes-1.15.1/busybox-1.15.1-find.patch
> 
> It is planned to go into 1.15.2

the posted patch isnt entirely correct.  it didnt protect the zeroing of the 
new xdev vals when xdev support is turned off.  ive fixed the patch on the 
server, but it seems the 1.15 branch isnt being kept up to date with the 
posted patches, so you'll have to take care of this when git is finally 
updated.

--- busybox-1.15.1/findutils/find.c
+++ busybox-1.15.1/findutils/find.c
@@ -109,8 +109,8 @@ struct globals {
        struct G_sizecheck { \
                char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \
        }; \
-       G.xdev_dev = NULL; \
-       G.xdev_count = 0; \
+       IF_FEATURE_FIND_XDEV(G.xdev_dev = NULL;) \
+       IF_FEATURE_FIND_XDEV(G.xdev_count = 0;) \
        G.actions = NULL; \
        G.need_print = 1; \
        G.recurse_flags = ACTION_RECURSE; \
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20091005/880fb283/attachment.pgp>


More information about the busybox mailing list