Hi Rob,
My patch was
+// is recursive tree
+static int is_recursive_loop(struct dirtree *node)
+{
+ struct dirtree *tmp = node;
+
+ while ((tmp = tmp-parent)) {
+if ((tmp-st.st_ino == node-st.st_ino)
+(tmp-st.st_dev == node-st.st_dev))
+ return 1;
+ }
+ return 0;
+}
+
//
On 12/01/14 05:40, Ashwini Sharma wrote:
Hi Rob,
...
$ du -L sub
without my patch it will keep looping. This patch stops from this looping.
Thanks,
Ashwini
Ah, you're fixing the -L case. (I'd mentally written that off as pilot
error, but I see Ubuntu's du implementation doesn't loop.)
Going through Ashwini's patch stack from last month. (Sorry for the delay,
but I think I applied all the trivial ones in earlier passes.)
What does the du.c patch do?
$ mkdir sub
$ ln -s . sub/here
$ ln -s loop sub/loop
$ ./toybox du sub
4 sub
There's also a hardlink filter