From 0689a4a16f5e80e0c2368f4a68c69ce5f2fdc038 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 13 Feb 2019 11:12:30 -0500 Subject: bftw: Work around d_type being wrong for bind mounts on Linux C.f. https://savannah.gnu.org/bugs/?54913 C.f. https://lkml.org/lkml/2019/2/11/2027 Fixes https://github.com/tavianator/bfs/issues/37 --- eval.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 028b31d..bb89401 100644 --- a/eval.c +++ b/eval.c @@ -1400,19 +1400,26 @@ int eval_cmdline(const struct cmdline *cmdline) { .ptr = &args, .nopenfd = infer_fdlimit(cmdline), .flags = cmdline->flags, + .mtab = cmdline->mtab, }; for (struct root *root = cmdline->roots; root && !args.quit; root = root->next) { if (cmdline->debug & DEBUG_SEARCH) { fprintf(stderr, - "bftw(\"%s\", { " - ".callback = cmdline_callback, " - ".ptr = &args, " - ".nopenfd = %d, " - ".flags = ", - root->path, - bftw_args.nopenfd); + "bftw(\"%s\", { " + ".callback = cmdline_callback, " + ".ptr = &args, " + ".nopenfd = %d, " + ".flags = ", + root->path, + bftw_args.nopenfd); dump_bftw_flags(bftw_args.flags); + fprintf(stderr, ", .mtab = "); + if (bftw_args.mtab) { + fprintf(stderr, "cmdline->mtab"); + } else { + fprintf(stderr, "NULL"); + } fprintf(stderr, " })\n"); } -- cgit v1.2.3