[find] disable loop detection
We don't have unique inodes and device numbers so loop detection
is broken, but since we don't have symlinks we can simply disable
it for now.
Change-Id: Ice1f735ec46aa60a7747b1786ecfd799d52857c8
diff --git a/find.c b/find.c
index e095015..cd2c7a5 100644
--- a/find.c
+++ b/find.c
@@ -937,7 +937,7 @@
struct stat st;
DIR *dir;
struct dirent *de;
- struct findhist *f, cur;
+ struct findhist cur;
size_t namelen, pathcap = 0, len;
struct arg arg = { path, &st, { NULL } };
char *p, *pathbuf = NULL;
@@ -964,12 +964,20 @@
(gflags.xdev && hist && st.st_dev != hist->dev))
return;
- for (f = hist; f; f = f->next) {
+#ifndef __Fuchsia__
+ // Fuchsia's filesystems do not currently report unique
+ // device and inode numbers through stat, so find thinks
+ // everything's a loop. Since Fuchsia does not support
+ // symlinks in filesystems yet, it's safe to ignore this
+ // loop detection for now.
+ for (struct findhist *f = hist; f; f = f->next) {
if (f->dev == st.st_dev && f->ino == st.st_ino) {
weprintf("loop detected '%s' is '%s'\n", path, f->path);
return;
}
}
+#endif
+
cur.next = hist;
cur.path = path;
cur.dev = st.st_dev;